category_model.dart 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. class CategoryModel {
  2. String code;
  3. String message;
  4. List<CategoryData> data;
  5. static CategoryModel fromMap(Map<String, dynamic> map) {
  6. CategoryModel category = new CategoryModel();
  7. category.code = map['code'];
  8. category.message = map['message'];
  9. category.data = CategoryData.fromMapList(map['data']);
  10. return category;
  11. }
  12. static List<CategoryModel> fromMapList(dynamic mapList) {
  13. List<CategoryModel> list = new List(mapList.length);
  14. for (int i = 0; i < mapList.length; i++) {
  15. list[i] = fromMap(mapList[i]);
  16. }
  17. return list;
  18. }
  19. }
  20. class CategoryData {
  21. String mallCategoryId;
  22. String mallCategoryName;
  23. String image;
  24. List<BxMallSubDtoListBean> bxMallSubDto;
  25. static CategoryData fromMap(Map<String, dynamic> map) {
  26. CategoryData dataListBean = new CategoryData();
  27. dataListBean.mallCategoryId = map['mallCategoryId'];
  28. dataListBean.mallCategoryName = map['mallCategoryName'];
  29. dataListBean.image = map['image'];
  30. dataListBean.bxMallSubDto = BxMallSubDtoListBean.fromMapList(map['bxMallSubDto']);
  31. return dataListBean;
  32. }
  33. static List<CategoryData> fromMapList(dynamic mapList) {
  34. List<CategoryData> list = new List(mapList.length);
  35. for (int i = 0; i < mapList.length; i++) {
  36. list[i] = fromMap(mapList[i]);
  37. }
  38. return list;
  39. }
  40. }
  41. class BxMallSubDtoListBean {
  42. String mallSubId;
  43. String mallCategoryId;
  44. String mallSubName;
  45. String comments;
  46. static BxMallSubDtoListBean fromMap(Map<String, dynamic> map) {
  47. BxMallSubDtoListBean bxMallSubDtoListBean = new BxMallSubDtoListBean();
  48. bxMallSubDtoListBean.mallSubId = map['mallSubId'];
  49. bxMallSubDtoListBean.mallCategoryId = map['mallCategoryId'];
  50. bxMallSubDtoListBean.mallSubName = map['mallSubName'];
  51. bxMallSubDtoListBean.comments = map['comments'];
  52. return bxMallSubDtoListBean;
  53. }
  54. static List<BxMallSubDtoListBean> fromMapList(dynamic mapList) {
  55. List<BxMallSubDtoListBean> list = new List(mapList.length);
  56. for (int i = 0; i < mapList.length; i++) {
  57. list[i] = fromMap(mapList[i]);
  58. }
  59. return list;
  60. }
  61. }