基础库
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.
 
 
 
 
 

107 line
1.8 KiB

  1. import 'package:equatable/equatable.dart';
  2. import 'package:json_annotation/json_annotation.dart';
  3. part 'widget_model.g.dart';
  4. @JsonSerializable()
  5. // ignore: must_be_immutable
  6. class WidgetModel extends Object implements Equatable {
  7. @JsonKey(name: 'aspect_ratio')
  8. String aspectRatio;
  9. @JsonKey(name: 'badge')
  10. String badge;
  11. @JsonKey(name: 'bg_color')
  12. String bgColor;
  13. @JsonKey(name: 'bg_color_t')
  14. String bgColorT;
  15. @JsonKey(name: 'bg_img')
  16. String bgImg;
  17. @JsonKey(name: 'components')
  18. List<WidgetModel> components;
  19. @JsonKey(name: 'data')
  20. String data;
  21. @JsonKey(name: 'font_color')
  22. String fontColor;
  23. @JsonKey(name: 'icon')
  24. String icon;
  25. @JsonKey(name: 'img')
  26. String img;
  27. @JsonKey(name: 'is_global')
  28. int isGlobal;
  29. @JsonKey(name: 'margin')
  30. String margin;
  31. @JsonKey(name: 'mod_id')
  32. int modId;
  33. @JsonKey(name: 'mod_name')
  34. String modName;
  35. @JsonKey(name: 'mod_pid')
  36. int modPid;
  37. @JsonKey(name: 'path')
  38. String path;
  39. @JsonKey(name: 'position')
  40. String position;
  41. @JsonKey(name: 'sort')
  42. int sort;
  43. @JsonKey(name: 'subtitle')
  44. String subtitle;
  45. @JsonKey(name: 'title')
  46. String title;
  47. @JsonKey(name: 'url')
  48. String url;
  49. WidgetModel(
  50. this.aspectRatio,
  51. this.badge,
  52. this.bgColor,
  53. this.bgColorT,
  54. this.bgImg,
  55. this.components,
  56. this.data,
  57. this.fontColor,
  58. this.icon,
  59. this.img,
  60. this.isGlobal,
  61. this.margin,
  62. this.modId,
  63. this.modName,
  64. this.modPid,
  65. this.path,
  66. this.position,
  67. this.sort,
  68. this.subtitle,
  69. this.title,
  70. this.url,
  71. );
  72. factory WidgetModel.fromJson(Map<String, dynamic> srcJson) =>
  73. _$WidgetModelFromJson(srcJson);
  74. Map<String, dynamic> toJson() => _$WidgetModelToJson(this);
  75. @override
  76. List<Object> get props => [modId];
  77. @override
  78. bool get stringify => null;
  79. }