import 'package:zhiying_comm/zhiying_comm.dart'; class HomeBannerModel { List list; HomeBannerModel({this.list}); factory HomeBannerModel.fromJson(Map json) { return HomeBannerModel( list: json['list'] != null ? (json['list'] as List) .map((i) => HomeBannerListItemModel.fromJson(i)) .toList() : null, ); } Map toJson() { final Map data = new Map(); if (this.list != null) { data['list'] = this.list.map((v) => v.toJson()).toList(); } return data; } } class HomeBannerListItemModel extends SkipModel { String img; HomeBannerListItemModel({this.img}); HomeBannerListItemModel.fromJson(Map json) { super.fromJson(json); img = json['img']?.toString(); } Map toJson() { final Map data = super.toJson(); data['img'] = this.img; return data; } }