toJson method

Map<String, Object?> toJson({
  1. bool includePng = true,
})

Metadata, plus the thumbnail as base64 PNG when includePng and one is held (see encodeThumbnailPng).

Implementation

Map<String, Object?> toJson({bool includePng = true}) => {
  'key': key,
  'pass': passIndex,
  if (debugName != null) 'debugName': debugName,
  'width': width,
  'height': height,
  if (format != null) 'format': format!.name,
  'sampleCount': sampleCount,
  if (storageMode != null) 'storageMode': storageMode!.name,
  'isTexture': isTexture,
  if (byteLength != null) 'byteLength': byteLength,
  'snapshotFailed': snapshotFailed,
  if (includePng && thumbnailPng != null)
    'thumbnailPng': base64Encode(thumbnailPng!),
};