copyWith method

BlobResourceContents copyWith({
  1. String? blob,
  2. String? mimeType,
  3. String? uri,
  4. Map<String, Object?>? meta,
})

A copy with the given properties replaced; everything else, unknown keys included, is kept.

Implementation

BlobResourceContents copyWith({
  String? blob,
  String? mimeType,
  String? uri,
  Map<String, Object?>? meta,
}) =>
    BlobResourceContents.fromJson({
      ...toJson(),
      if (blob != null) 'blob': $encode(blob),
      if (mimeType != null) 'mimeType': $encode(mimeType),
      if (uri != null) 'uri': $encode(uri),
      if (meta != null) '_meta': $encode(meta),
    });