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