OrderProductModel.fromJson constructor
OrderProductModel.fromJson(
- Map<String, dynamic> json
)
Implementation
factory OrderProductModel.fromJson(Map<String, dynamic> json) {
return OrderProductModel(
id: json['_id'],
description: json['description'],
price: json['price'] != null ? json['price'].toDouble() : 0.0,
orderStatus: json['orderStatus'],
riderStatus: json['riderStatus'],
productIdList: json['productIdList'].cast<String>(),
productList: List.from(json['productList'] ?? [])
.map((e) => ProductModel.fromJson(e))
.toList(),
customerId: json['customerId'],
riderId: json['riderId'],
shopId: json['shopId'],
shopName: json['shopName'],
paid: json['paid'],
complete: json['complete']);
}