copyWith method

MaterialResource copyWith({
  1. String? type,
  2. String? name,
  3. Map<String, PropertyValue>? properties,
  4. AssetRef? asset,
})

A copy with the given fields replaced, so rewriters carry every other field (including ones added later) without listing them.

Implementation

MaterialResource copyWith({
  String? type,
  String? name,
  Map<String, PropertyValue>? properties,
  AssetRef? asset,
}) => MaterialResource(
  id,
  type: type ?? this.type,
  name: name ?? this.name,
  properties: properties ?? this.properties,
  asset: asset ?? this.asset,
);