copy method

OrderModel<T> copy({
  1. String? id,
  2. String? name,
  3. String? ordererId,
  4. Option<CouponModel>? coupon,
  5. int? totalPrice,
  6. int? discount,
  7. int? deliveryTip,
  8. int? actualPaymentPrice,
  9. ApartmentModel? apartment,
  10. String? userPhoneNumber,
  11. String? detailedAddress,
  12. Iterable<T>? menus,
  13. DateTime? updatedAt,
  14. DateTime? createdAt,
})

Implementation

OrderModel<T> copy({
  String? id,
  String? name,
  String? ordererId,
  Option<CouponModel>? coupon,
  int? totalPrice,
  int? discount,
  int? deliveryTip,
  int? actualPaymentPrice,
  ApartmentModel? apartment,
  String? userPhoneNumber,
  String? detailedAddress,
  Iterable<T>? menus,
  DateTime? updatedAt,
  DateTime? createdAt,
}) {
  return OrderModel(
    id: id ?? this.id,
    name: name ?? this.name,
    ordererId: ordererId ?? this.ordererId,
    coupon: coupon != null ? coupon.value : this.coupon,
    totalPrice: totalPrice ?? this.totalPrice,
    discount: discount ?? this.discount,
    actualPaymentPrice: actualPaymentPrice ?? this.actualPaymentPrice,
    apartment: apartment ?? this.apartment,
    userPhoneNumber: userPhoneNumber ?? this.userPhoneNumber,
    menus: menus ?? this.menus,
    createdAt: createdAt ?? this.createdAt,
    updatedAt: updatedAt ?? this.updatedAt,
  );
}