copyWith method
CalibreWeebi<A>
copyWith(
{ - int? id,
- String? title,
- StockUnit? stockUnit,
- ArticleKind? kind,
- String? photo,
- bool? status,
- DateTime? statusUpdateDate,
- List<A>? articles,
- DateTime? creationDate,
- DateTime? updateDate,
- List<String>? categories,
})
Implementation
CalibreWeebi<A> copyWith({
int? id,
String? title,
StockUnit? stockUnit,
ArticleKind? kind,
String? photo,
bool? status,
DateTime? statusUpdateDate,
List<A>? articles,
DateTime? creationDate,
DateTime? updateDate,
List<String>? categories,
}) {
return CalibreWeebi<A>(
id: id ?? this.id,
title: title ?? this.title,
stockUnit: stockUnit ?? this.stockUnit,
kind: kind ?? this.kind,
status: status ?? this.status,
statusUpdateDate: statusUpdateDate ?? this.statusUpdateDate,
articles: articles ??
this.articles.map((e) => e).toList(), // a real copy, not a reference
creationDate: creationDate ?? this.creationDate,
updateDate: updateDate ?? this.updateDate,
);
}