mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-19 16:46:22 +08:00
committed by
GitHub
parent
c899ea95e1
commit
8d34e6f340
@@ -1,11 +1,11 @@
|
||||
import 'package:PiliPlus/models/dynamics/article_list/article.dart';
|
||||
import 'package:PiliPlus/models/dynamics/article_list/author.dart';
|
||||
import 'package:PiliPlus/models/dynamics/article_list/list.dart';
|
||||
import 'package:PiliPlus/models/model_owner.dart';
|
||||
import 'package:PiliPlus/models/space_article/item.dart';
|
||||
|
||||
class ArticleListData {
|
||||
ArticleList? list;
|
||||
List<Article>? articles;
|
||||
Author? author;
|
||||
List<SpaceArticleItem>? articles;
|
||||
Owner? author;
|
||||
bool? attention;
|
||||
|
||||
ArticleListData({
|
||||
@@ -21,18 +21,11 @@ class ArticleListData {
|
||||
? null
|
||||
: ArticleList.fromJson(json['list'] as Map<String, dynamic>),
|
||||
articles: (json['articles'] as List<dynamic>?)
|
||||
?.map((e) => Article.fromJson(e as Map<String, dynamic>))
|
||||
?.map((e) => SpaceArticleItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
author: json['author'] == null
|
||||
? null
|
||||
: Author.fromJson(json['author'] as Map<String, dynamic>),
|
||||
: Owner.fromJson(json['author'] as Map<String, dynamic>),
|
||||
attention: json['attention'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'list': list?.toJson(),
|
||||
'articles': articles?.map((e) => e.toJson()).toList(),
|
||||
'author': author?.toJson(),
|
||||
'attention': attention,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user