copyWith method

BaseMetadata copyWith({
  1. String? name,
  2. String? title,
})

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

Implementation

BaseMetadata copyWith({
  String? name,
  String? title,
}) =>
    BaseMetadata.fromJson({
      ...toJson(),
      if (name != null) 'name': $encode(name),
      if (title != null) 'title': $encode(title),
    });