mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-25 21:05:52 +08:00
feat: fav topic
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
23
lib/models/user/fav_topic/topic_list.dart
Normal file
23
lib/models/user/fav_topic/topic_list.dart
Normal 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(),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user