Files
2024-09-27 01:32:49 +08:00

40 lines
1.0 KiB
Dart
Executable File

class StyleModel {
final int status;
final int length;
final String copyright;
final List<Infos> data;
StyleModel({ this.status, this.length, this.copyright, this.data });
factory StyleModel.fromJson(Map<String, dynamic> parsedJson){
var list = parsedJson['data'] as List;
List<Infos> imageinfo = list.map((i) => Infos.fromJson(i)).toList();
return StyleModel(
status: parsedJson['status'],
length: parsedJson['name'],
copyright: parsedJson['copyright'],
data: imageinfo,
);
}
}
class Infos {
final String title;
final String imgurl;
final String href;
final String view;
final String comments;
Infos({ this.title, this.imgurl, this.href, this.view, this.comments });
factory Infos.fromJson(Map<String, dynamic> parsedJson){
return Infos(
title: parsedJson['title'] as String,
imgurl: parsedJson['imgurl'] as String,
href: parsedJson['href'] as String,
view: parsedJson['view'] as String,
comments: parsedJson['comments'] as String,
);
}
}