Files
PiliPlus/lib/models/folder_info/data.dart
bggRGjQaUbCoE 924d51d41b opt handle res
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
2025-05-29 17:17:42 +08:00

91 lines
2.2 KiB
Dart

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<String, dynamic> 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<String, dynamic>),
coverType: json['cover_type'] as int?,
cntInfo: json['cnt_info'] == null
? null
: CntInfo.fromJson(json['cnt_info'] as Map<String, dynamic>),
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<String, dynamic> 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,
};
}