copyWith method

Background copyWith({
  1. int? id,
  2. bool? isDefault,
  3. bool? isDark,
  4. String? name,
  5. Document? document()?,
  6. BackgroundType? type,
  7. dynamic extra,
  8. int? clientId,
})

Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.

Implementation

Background copyWith({
  int? id,
  bool? isDefault,
  bool? isDark,
  String? name,
  Document? Function()? document,
  BackgroundType? type,
  dynamic extra,
  int? clientId,
}) => Background(
  id: id ?? this.id,
  isDefault: isDefault ?? this.isDefault,
  isDark: isDark ?? this.isDark,
  name: name ?? this.name,
  document: document != null ? document() : this.document,
  type: type ?? this.type,
  extra: extra ?? this.extra,
  clientId: clientId ?? this.clientId,
);