Files
PiliPlus/lib/models/search/search_trending/trending_data.dart
bggRGjQaUbCoE bc9c20c509 feat: search trending page
Closes #684

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
2025-04-14 23:43:47 +08:00

29 lines
1008 B
Dart

import 'package:PiliPlus/models/search/search_trending/trending_list.dart';
class TrendingData {
String? trackid;
List<TrendingList>? list;
List<TrendingList>? topList;
String? hotwordEggInfo;
TrendingData({this.trackid, this.list, this.topList, this.hotwordEggInfo});
factory TrendingData.fromJson(Map<String, dynamic> json) => TrendingData(
trackid: json['trackid'] as String?,
list: (json['list'] as List<dynamic>?)
?.map((e) => TrendingList.fromJson(e as Map<String, dynamic>))
.toList(),
topList: (json['top_list'] as List<dynamic>?)
?.map((e) => TrendingList.fromJson(e as Map<String, dynamic>))
.toList(),
hotwordEggInfo: json['hotword_egg_info'] as String?,
);
Map<String, dynamic> toJson() => {
'trackid': trackid,
'list': list?.map((e) => e.toJson()).toList(),
'top_list': topList?.map((e) => e.toJson()).toList(),
'hotword_egg_info': hotwordEggInfo,
};
}