Files
PiliPlus/lib/models/live/live_follow/data.dart
bggRGjQaUbCoE fcb7330970 mod: update whisper badge
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
2025-05-06 22:44:34 +08:00

53 lines
1.4 KiB
Dart

import 'package:PiliPlus/models/live/live_follow/item.dart';
class LiveFollowData {
String? title;
int? pageSize;
int? totalPage;
List<LiveFollowItem>? list;
int? count;
int? neverLivedCount;
int? liveCount;
List<dynamic>? neverLivedFaces;
LiveFollowData({
this.title,
this.pageSize,
this.totalPage,
this.list,
this.count,
this.neverLivedCount,
this.liveCount,
this.neverLivedFaces,
});
LiveFollowData.fromJson(Map<String, dynamic> json) {
title = json['title'] as String?;
pageSize = json['pageSize'] as int?;
totalPage = json['totalPage'] as int?;
if ((json['list'] as List<dynamic>?)?.isNotEmpty == true) {
list = <LiveFollowItem>[];
for (var json in json['list']) {
if (json['live_status'] == 1) {
list!.add(LiveFollowItem.fromJson(json));
}
}
}
count = json['count'] as int?;
neverLivedCount = json['never_lived_count'] as int?;
liveCount = json['live_count'] as int?;
neverLivedFaces = json['never_lived_faces'] as List<dynamic>?;
}
Map<String, dynamic> toJson() => {
'title': title,
'pageSize': pageSize,
'totalPage': totalPage,
'list': list?.map((e) => e.toJson()).toList(),
'count': count,
'never_lived_count': neverLivedCount,
'live_count': liveCount,
'never_lived_faces': neverLivedFaces,
};
}