copyWith method

ImageContent copyWith({
  1. Annotations? annotations,
  2. String? data,
  3. String? mimeType,
  4. Map<String, Object?>? meta,
})

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

Implementation

ImageContent copyWith({
  Annotations? annotations,
  String? data,
  String? mimeType,
  Map<String, Object?>? meta,
}) =>
    ImageContent.fromJson({
      ...toJson(),
      if (annotations != null) 'annotations': $encode(annotations),
      if (data != null) 'data': $encode(data),
      if (mimeType != null) 'mimeType': $encode(mimeType),
      if (meta != null) '_meta': $encode(meta),
    });