copyWith method

EmbeddedResource copyWith({
  1. Annotations? annotations,
  2. ResourceContents? resource,
  3. Map<String, Object?>? meta,
})

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

Implementation

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