feat: fav topic

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-17 21:55:36 +08:00
parent 1d4eabb770
commit d7eb734aaf
55 changed files with 1509 additions and 500 deletions

View File

@@ -0,0 +1,23 @@
import 'package:PiliPlus/models/user/fav_topic/page_info.dart';
import 'package:PiliPlus/models/user/fav_topic/topic_item.dart';
class TopicList {
List<FavTopicModel>? topicItems;
PageInfo? pageInfo;
TopicList({this.topicItems, this.pageInfo});
factory TopicList.fromJson(Map<String, dynamic> json) => TopicList(
topicItems: (json['topic_items'] as List<dynamic>?)
?.map((e) => FavTopicModel.fromJson(e as Map<String, dynamic>))
.toList(),
pageInfo: json['page_info'] == null
? null
: PageInfo.fromJson(json['page_info'] as Map<String, dynamic>),
);
Map<String, dynamic> toJson() => {
'topic_items': topicItems?.map((e) => e.toJson()).toList(),
'page_info': pageInfo?.toJson(),
};
}