DeliveryOrderModel.fromJson constructor
DeliveryOrderModel.fromJson(
- dynamic json
Implementation
factory DeliveryOrderModel.fromJson(dynamic json) {
return DeliveryOrderModel(
id: json["id"],
name: json["name"],
ordererId: json["ordererId"],
coupon:
json["coupon"] != null ? CouponModel.fromjson(json["coupon"]) : null,
totalPrice: json["totalPrice"],
discount: json["discount"],
deliveryTip: json["deliveryTip"],
actualPaymentPrice: json["actualPaymentPrice"],
apartment: ApartmentModel.fromJson(json["apartment"]),
userPhoneNumber: json["userPhoneNumber"],
detailedAddress: json["detailedAddress"],
menus: (json["menus"] as Iterable).map(OrderMenuModel.fromJson),
createdAt: DateTime.parse(json["createdAt"]).toLocal(),
updatedAt: DateTime.parse(json["updatedAt"]).toLocal(),
);
}