copyWith method
A copy with the given properties replaced; everything else, unknown keys included, is kept.
Implementation
TextResourceContents copyWith({
String? mimeType,
String? text,
String? uri,
Map<String, Object?>? meta,
}) =>
TextResourceContents.fromJson({
...toJson(),
if (mimeType != null) 'mimeType': $encode(mimeType),
if (text != null) 'text': $encode(text),
if (uri != null) 'uri': $encode(uri),
if (meta != null) '_meta': $encode(meta),
});