toJson method Null safety

Map<String, Object?> toJson ()

Returns a JSON encodable representation of this object.

Implementation

Map<String, Object?> toJson() {
  return <String, Object?>{
    'source': source,
    if (displaySize != null)
      'displaySize': <String, Object?>{
        'width': displaySize!.width,
        'height': displaySize!.height,
      },
    'imageSize': <String, Object?>{
      'width': imageSize.width,
      'height': imageSize.height,
    },
    'displaySizeInBytes': displaySizeInBytes,
    'decodedSizeInBytes': decodedSizeInBytes,
  };
}