models.dart 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. class OrderListObj{
  2. List<OrderList> orderList;
  3. bool hasNextPage;
  4. OrderListObj({this.hasNextPage,this.orderList});
  5. factory OrderListObj.fromJson(Map<String,dynamic> json){
  6. List list = json['items'] as List;
  7. List<OrderList> tempOrderList = list.map((i)=>OrderList.fromJson(i)).toList();
  8. return OrderListObj(
  9. hasNextPage:json['hasNextPage'],
  10. orderList: tempOrderList
  11. );
  12. }
  13. }
  14. class OrderList{
  15. int id;
  16. int orderNo;
  17. String createTime;
  18. String startAddress;
  19. String endAddress;
  20. String itemName;
  21. int itemNo;
  22. String sendPhone;
  23. String sendAddress;
  24. String getPhone;
  25. String getAddress;
  26. OrderList({
  27. this.id,
  28. this.orderNo,
  29. this.createTime,
  30. this.startAddress,
  31. this.endAddress,
  32. this.itemName,
  33. this.itemNo,
  34. this.sendPhone,
  35. this.sendAddress,
  36. this.getPhone,
  37. this.getAddress
  38. });
  39. factory OrderList.fromJson(Map<String,dynamic> json){
  40. return OrderList(
  41. id:json['id'],
  42. orderNo:json['orderNo'],
  43. createTime:json['createTime'],
  44. startAddress:json['startAddress'],
  45. endAddress:json['endAddress'],
  46. itemName:json['itemName'],
  47. itemNo:json['itemNo'],
  48. sendPhone:json['sendPhone'],
  49. sendAddress: json['sendAddress'],
  50. getPhone:json['getPhone'],
  51. getAddress:json['getAddress']
  52. );
  53. }
  54. }