copyWith method

User copyWith({
  1. String? id,
  2. String? name,
  3. int? age,
  4. List<String>? tags,
  5. Set<int>? scores,
  6. Map<String, String>? metadata,
  7. Set<String>? tagsSet,
  8. Map<String, int>? stats,
})

Implementation

User copyWith({
  String? id,
  String? name,
  int? age,
  List<String>? tags,
  Set<int>? scores,
  Map<String, String>? metadata,
  Set<String>? tagsSet,
  Map<String, int>? stats,
}) {
  return User(
    id: id ?? this.id,
    name: name ?? this.name,
    age: age ?? this.age,
    tags: tags ?? this.tags,
    scores: scores ?? this.scores,
    metadata: metadata ?? this.metadata,
    tagsSet: tagsSet ?? this.tagsSet,
    stats: stats ?? this.stats,
  );
}