/// banner model class BannerModel { String title; // 标题 int id; // id String url; // 路径 String imagePath; // 图片路径 BannerModel.fromJson(Map<String, dynamic> json) : title = json['title'], id = json['id'], url = json['url'], imagePath = json['imagePath']; Map<String, dynamic> toJson() => { 'title': title, 'id': id, 'url': url, 'imagePath': imagePath, }; @override String toString() { StringBuffer sb = new StringBuffer('{'); sb.write("\"title\":\"$title\""); sb.write(",\"id\":$id"); sb.write(",\"url\":\"$url\""); sb.write(",\"imagePath\":\"$imagePath\""); sb.write('}'); return sb.toString(); } }