mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-19 08:36:17 +08:00
refa: live page
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
44
lib/models/live/live_feed_index/card_data_item.dart
Normal file
44
lib/models/live/live_feed_index/card_data_item.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:PiliPlus/models/live/live_feed_index/card_data_list_item.dart';
|
||||
|
||||
import 'module_info.dart';
|
||||
|
||||
class CardDataItem {
|
||||
ModuleInfo? moduleInfo;
|
||||
List<CardLiveItem>? list;
|
||||
dynamic topView;
|
||||
ExtraInfo? extraInfo;
|
||||
|
||||
CardDataItem({
|
||||
this.moduleInfo,
|
||||
this.list,
|
||||
this.topView,
|
||||
this.extraInfo,
|
||||
});
|
||||
|
||||
factory CardDataItem.fromJson(Map<String, dynamic> json) => CardDataItem(
|
||||
moduleInfo: json['module_info'] == null
|
||||
? null
|
||||
: ModuleInfo.fromJson(json['module_info'] as Map<String, dynamic>),
|
||||
list: (json['list'] as List<dynamic>?)
|
||||
?.map((e) => CardLiveItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
topView: json['top_view'] as dynamic,
|
||||
extraInfo: json['extra_info'] == null
|
||||
? null
|
||||
: ExtraInfo.fromJson(json['extra_info'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'module_info': moduleInfo?.toJson(),
|
||||
'list': list?.map((e) => e.toJson()).toList(),
|
||||
'top_view': topView,
|
||||
};
|
||||
}
|
||||
|
||||
class ExtraInfo {
|
||||
int? totalCount;
|
||||
|
||||
ExtraInfo.fromJson(Map<String, dynamic> json) {
|
||||
totalCount = json['total_count'];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user