import 'package:PiliPlus/models/folder_info/cnt_info.dart'; import 'package:PiliPlus/models/folder_info/upper.dart'; class FolderInfo { int? id; int? fid; int? mid; int? attr; String? title; String? cover; Upper? upper; int? coverType; CntInfo? cntInfo; int? type; String? intro; int? ctime; int? mtime; int? state; int? favState; int? likeState; int? mediaCount; bool? isTop; FolderInfo({ this.id, this.fid, this.mid, this.attr, this.title, this.cover, this.upper, this.coverType, this.cntInfo, this.type, this.intro, this.ctime, this.mtime, this.state, this.favState, this.likeState, this.mediaCount, this.isTop, }); factory FolderInfo.fromJson(Map json) => FolderInfo( id: json['id'] as int?, fid: json['fid'] as int?, mid: json['mid'] as int?, attr: json['attr'] as int?, title: json['title'] as String?, cover: json['cover'] as String?, upper: json['upper'] == null ? null : Upper.fromJson(json['upper'] as Map), coverType: json['cover_type'] as int?, cntInfo: json['cnt_info'] == null ? null : CntInfo.fromJson(json['cnt_info'] as Map), type: json['type'] as int?, intro: json['intro'] as String?, ctime: json['ctime'] as int?, mtime: json['mtime'] as int?, state: json['state'] as int?, favState: json['fav_state'] as int?, likeState: json['like_state'] as int?, mediaCount: json['media_count'] as int?, isTop: json['is_top'] as bool?, ); Map toJson() => { 'id': id, 'fid': fid, 'mid': mid, 'attr': attr, 'title': title, 'cover': cover, 'upper': upper?.toJson(), 'cover_type': coverType, 'cnt_info': cntInfo?.toJson(), 'type': type, 'intro': intro, 'ctime': ctime, 'mtime': mtime, 'state': state, 'fav_state': favState, 'like_state': likeState, 'media_count': mediaCount, 'is_top': isTop, }; }