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.

34 lines
793 B

class ImgModel {
String url;
String size;
int longs;
int paragraph;
int sort;
ImgModel({this.url, this.size, this.longs, this.paragraph, this.sort});
ImgModel.fromJson(Map<String, dynamic> json) {
url = json['url'];
size = json['size'];
longs = json['longs'];
paragraph = json['paragraph'];
sort = json['sort'];
}
static String first(List<ImgModel> models) {
if (models == null) return '';
if (models.isEmpty) return '';
return models.first.url ?? '';
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
data['size'] = this.size;
data['longs'] = this.longs;
data['paragraph'] = this.paragraph;
data['sort'] = this.sort;
return data;
}
}