class TotalContentModel { List contents; int lastPage; TotalContentModel({required this.contents, required this.lastPage}); factory TotalContentModel.fromJson(Map json) { return TotalContentModel( contents: List.from( json['contents'].map((content) => TotalContent.fromJson(content))), lastPage: json['lastPage'], ); } Map toJson() { return { 'contents': List.from(contents.map((x) => x.toJson())), 'lastPage': lastPage, }; } } class TotalContent { final int id; final String label; final String title; final int type; final bool marked; final List data; TotalContent({ required this.id, required this.label, required this.title, required this.type, required this.marked, required this.data, }); factory TotalContent.fromJson(Map json) { return TotalContent( id: json['id'], label: json['label'], title: json['title'], type: json['type'], marked: json['marked'], data: List.from( json['data'].map((data) => DataItem.fromJson(data))), ); } Map toJson() { return { 'id': id, 'label': label, 'title': title, 'type': type, 'marked': marked, 'data': data.map((dataItem) => dataItem.toJson()).toList(), }; } } class DataItem { final String name; final dynamic q; final dynamic v; final dynamic p; final dynamic y; final dynamic d; final dynamic f; final dynamic l; final dynamic dl; final dynamic dp; final String? dt; DataItem({ required this.name, this.q, this.v, this.p, this.y, this.d, this.f, this.l, this.dl, this.dp, this.dt, }); factory DataItem.fromJson(Map json) { return DataItem( name: json['name'], q: json['q'], v: json['v'], p: json['p'], y: json['y'], d: json['d'], f: json['f'], l: json['l'], dl: json['dl'], dp: json['dp'], dt: json['dt'], ); } Map toJson() { return { 'name': name, 'q': q, 'v': v, 'p': p, 'y': y, 'd': d, 'f': f, 'l': l, 'dl': dl, 'dp': dp, 'dt': dt, }; } }