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

HomeBannerModel.dart 1020 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import 'package:zhiying_comm/zhiying_comm.dart';
  2. class HomeBannerModel {
  3. List<HomeBannerListItemModel> list;
  4. HomeBannerModel({this.list});
  5. factory HomeBannerModel.fromJson(Map<String, dynamic> json) {
  6. return HomeBannerModel(
  7. list: json['list'] != null
  8. ? (json['list'] as List)
  9. .map((i) => HomeBannerListItemModel.fromJson(i))
  10. .toList()
  11. : null,
  12. );
  13. }
  14. Map<String, dynamic> toJson() {
  15. final Map<String, dynamic> data = new Map<String, dynamic>();
  16. if (this.list != null) {
  17. data['list'] = this.list.map((v) => v.toJson()).toList();
  18. }
  19. return data;
  20. }
  21. }
  22. class HomeBannerListItemModel extends SkipModel {
  23. String img;
  24. HomeBannerListItemModel({this.img});
  25. HomeBannerListItemModel.fromJson(Map<String, dynamic> json) {
  26. super.fromJson(json);
  27. img = json['img']?.toString();
  28. }
  29. Map<String, dynamic> toJson() {
  30. final Map<String, dynamic> data = super.toJson();
  31. data['img'] = this.img;
  32. return data;
  33. }
  34. }