models.dart 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. class Login{
  2. bool success;
  3. int code;
  4. String msg;
  5. LoginMap data;
  6. Login({this.success,this.code,this.msg,this.data});
  7. factory Login.fromJson(Map<String,dynamic> json){
  8. LoginMap tempData = LoginMap.fromJson(json['data']);
  9. return Login(
  10. success: json['success'],
  11. code:json['code'],
  12. msg:json['msg'],
  13. data:tempData
  14. );
  15. }
  16. }
  17. class LoginMap {
  18. String avatarUrl;
  19. String nickName;
  20. int roleType;
  21. String userId;
  22. int status;
  23. String token;
  24. LoginMap({
  25. this.userId,
  26. this.avatarUrl,
  27. this.nickName,
  28. this.roleType,
  29. this.status,
  30. this.token
  31. });
  32. factory LoginMap.fromJson(Map < String, dynamic > json) {
  33. return LoginMap(
  34. avatarUrl: json['avatarUrl'],
  35. nickName: json['nickName'],
  36. roleType: json['roleType'],
  37. userId: json['userId'],
  38. status: json['status'],
  39. token: json['token'],
  40. );
  41. }
  42. }
  43. class OrderListObj {
  44. List < OrderList > orderList;
  45. bool hasNextPage;
  46. OrderListObj({
  47. this.hasNextPage,
  48. this.orderList
  49. });
  50. factory OrderListObj.fromJson(Map < String, dynamic > json) {
  51. List list = json['items'] as List;
  52. List < OrderList > tempOrderList = list.map((i) => OrderList.fromJson(i)).toList();
  53. return OrderListObj(
  54. hasNextPage: json['hasNextPage'],
  55. orderList: tempOrderList
  56. );
  57. }
  58. }
  59. class OrderList {
  60. int id;
  61. int orderNo;
  62. String createTime;
  63. String startAddress;
  64. String endAddress;
  65. String itemName;
  66. int itemNo;
  67. String sendPhone;
  68. String sendAddress;
  69. String getPhone;
  70. String getAddress;
  71. OrderList({
  72. this.id,
  73. this.orderNo,
  74. this.createTime,
  75. this.startAddress,
  76. this.endAddress,
  77. this.itemName,
  78. this.itemNo,
  79. this.sendPhone,
  80. this.sendAddress,
  81. this.getPhone,
  82. this.getAddress
  83. });
  84. factory OrderList.fromJson(Map < String, dynamic > json) {
  85. return OrderList(
  86. id: json['id'],
  87. orderNo: json['orderNo'],
  88. createTime: json['createTime'],
  89. startAddress: json['startAddress'],
  90. endAddress: json['endAddress'],
  91. itemName: json['itemName'],
  92. itemNo: json['itemNo'],
  93. sendPhone: json['sendPhone'],
  94. sendAddress: json['sendAddress'],
  95. getPhone: json['getPhone'],
  96. getAddress: json['getAddress']
  97. );
  98. }
  99. }