feat: search trending page

Closes #684

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-14 22:57:13 +08:00
parent 7cc0c83df1
commit bc9c20c509
14 changed files with 469 additions and 45 deletions

View File

@@ -0,0 +1,28 @@
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,
};
}