copy method

StoreModel copy({
  1. String? id,
  2. String? name,
  3. Option<String>? description,
  4. Option<String>? thumbnail,
  5. String? apartmentId,
  6. String? phone,
  7. bool? activated,
  8. int? throttle,
  9. DateTime? updatedAt,
  10. DateTime? createdAt,
  11. Iterable<AvailableTakeoutModel>? availableTakeouts,
  12. Iterable<ItemModel>? items,
})

Implementation

StoreModel copy({
  String? id,
  String? name,
  Option<String>? description,
  Option<String>? thumbnail,
  String? apartmentId,
  String? phone,
  bool? activated,
  int? throttle,
  DateTime? updatedAt,
  DateTime? createdAt,
  Iterable<AvailableTakeoutModel>? availableTakeouts,
  Iterable<ItemModel>? items,
}) {
  return StoreModel(
    id: id ?? this.id,
    name: name ?? this.name,
    description: description != null ? description.value : this.description,
    thumbnail: thumbnail != null ? thumbnail.value : this.thumbnail,
    apartmentId: apartmentId ?? this.apartmentId,
    phone: phone ?? this.phone,
    activated: activated ?? this.activated,
    throttle: throttle ?? this.throttle,
    updatedAt: updatedAt ?? this.updatedAt,
    createdAt: createdAt ?? this.createdAt,
    availableTakeouts: availableTakeouts ?? this.availableTakeouts,
    items: items ?? this.items,
  );
}