基础库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

173 lines
4.8 KiB

  1. import 'dart:convert';
  2. class TurnChainStyleModel {
  3. String appLogo;
  4. String commission;
  5. String provider;
  6. String providerName;
  7. String coupon;
  8. String totalSave;
  9. // String style;
  10. Style style;
  11. TurnChainStyleModel({
  12. this.appLogo,
  13. this.commission,
  14. this.provider,
  15. this.providerName,
  16. this.coupon,
  17. this.totalSave,
  18. this.style,
  19. });
  20. TurnChainStyleModel.fromJson(Map<String, dynamic> json) {
  21. appLogo = json['app_logo'];
  22. commission = json['commission'];
  23. provider = json['provider'];
  24. providerName = json['provider_name'];
  25. coupon = json['coupon'];
  26. totalSave = json['total_save'];
  27. if (null != json['style']) {
  28. style = json['style'] is String ? Style.fromJson(jsonDecode(json['style'])) : Style.fromJson(json['style']);
  29. }
  30. }
  31. Map<String, dynamic> toJson() {
  32. final Map<String, dynamic> data = new Map<String, dynamic>();
  33. data['app_logo'] = this.appLogo;
  34. data['commission'] = this.commission;
  35. data['provider'] = this.provider;
  36. data['provider_name'] = this.providerName;
  37. data['coupon'] = this.coupon;
  38. data['total_save'] = this.totalSave;
  39. // data['style'] = this.style;
  40. if (null != this.style) {
  41. data['style'] = style.toJson();
  42. }
  43. return data;
  44. }
  45. }
  46. class Style {
  47. String pointColor;
  48. String point2Color;
  49. String point3Color;
  50. String text;
  51. String textColor;
  52. String leftBtnType;
  53. String leftBtnText;
  54. String leftBtnTextColor;
  55. String leftBtnColor;
  56. String leftBtnImg;
  57. String rightBtnType;
  58. String rightBtnText;
  59. String rightBtnTextColor;
  60. String rightBtnColor;
  61. String rightBtnImg;
  62. String saveMomenyText;
  63. String saveMomenyColor;
  64. String tipText;
  65. String tipColor;
  66. List<ProviderIcons> providerIcons;
  67. Style(
  68. {this.pointColor,
  69. this.point2Color,
  70. this.point3Color,
  71. this.text,
  72. this.textColor,
  73. this.leftBtnType,
  74. this.leftBtnText,
  75. this.leftBtnTextColor,
  76. this.leftBtnColor,
  77. this.leftBtnImg,
  78. this.rightBtnType,
  79. this.rightBtnText,
  80. this.rightBtnTextColor,
  81. this.rightBtnColor,
  82. this.rightBtnImg,
  83. this.saveMomenyText,
  84. this.saveMomenyColor,
  85. this.tipText,
  86. this.tipColor,
  87. this.providerIcons});
  88. Style.fromJson(Map<String, dynamic> json) {
  89. pointColor = json['point_color'];
  90. point2Color = json['point2_color'];
  91. point3Color = json['point3_color'];
  92. text = json['text'];
  93. textColor = json['text_color'];
  94. leftBtnType = json['left_btn_type'];
  95. leftBtnText = json['left_btn_text'];
  96. leftBtnTextColor = json['left_btn_text_color'];
  97. leftBtnColor = json['left_btn_color'];
  98. leftBtnImg = json['left_btn_img'];
  99. rightBtnType = json['right_btn_type'];
  100. rightBtnText = json['right_btn_text'];
  101. rightBtnTextColor = json['right_btn_text_color'];
  102. rightBtnColor = json['right_btn_color'];
  103. rightBtnImg = json['right_btn_img'];
  104. saveMomenyText = json['save_momeny_text'];
  105. saveMomenyColor = json['save_momeny_color'];
  106. tipText = json['tip_text'];
  107. tipColor = json['tip_color'];
  108. if (json['provider_icons'] != null) {
  109. providerIcons = new List<ProviderIcons>();
  110. json['provider_icons'].forEach((v) {
  111. providerIcons.add(new ProviderIcons.fromJson(v));
  112. });
  113. }
  114. }
  115. Map<String, dynamic> toJson() {
  116. final Map<String, dynamic> data = new Map<String, dynamic>();
  117. data['point_color'] = this.pointColor;
  118. data['point2_color'] = this.point2Color;
  119. data['point3_color'] = this.point3Color;
  120. data['text'] = this.text;
  121. data['text_color'] = this.textColor;
  122. data['left_btn_type'] = this.leftBtnType;
  123. data['left_btn_text'] = this.leftBtnText;
  124. data['left_btn_text_color'] = this.leftBtnTextColor;
  125. data['left_btn_color'] = this.leftBtnColor;
  126. data['left_btn_img'] = this.leftBtnImg;
  127. data['right_btn_type'] = this.rightBtnType;
  128. data['right_btn_text'] = this.rightBtnText;
  129. data['right_btn_text_color'] = this.rightBtnTextColor;
  130. data['right_btn_color'] = this.rightBtnColor;
  131. data['right_btn_img'] = this.rightBtnImg;
  132. data['save_momeny_text'] = this.saveMomenyText;
  133. data['save_momeny_color'] = this.saveMomenyColor;
  134. data['tip_text'] = this.tipText;
  135. data['tip_color'] = this.tipColor;
  136. if (this.providerIcons != null) {
  137. data['provider_icons'] = this.providerIcons.map((v) => v.toJson()).toList();
  138. }
  139. return data;
  140. }
  141. }
  142. class ProviderIcons {
  143. String type;
  144. String name;
  145. String img;
  146. ProviderIcons({this.type, this.name, this.img});
  147. ProviderIcons.fromJson(Map<String, dynamic> json) {
  148. type = json['type'];
  149. name = json['name'];
  150. img = json['img'];
  151. }
  152. Map<String, dynamic> toJson() {
  153. final Map<String, dynamic> data = new Map<String, dynamic>();
  154. data['type'] = this.type;
  155. data['name'] = this.name;
  156. data['img'] = this.img;
  157. return data;
  158. }
  159. }