mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-18 16:16:14 +08:00
40 lines
1.2 KiB
Dart
40 lines
1.2 KiB
Dart
import 'package:PiliPlus/models/model_owner.dart';
|
|
import 'package:PiliPlus/models_new/article/article_list/article.dart';
|
|
import 'package:PiliPlus/models_new/article/article_list/last.dart';
|
|
import 'package:PiliPlus/models_new/article/article_list/list.dart';
|
|
|
|
class ArticleListData {
|
|
ArticleListInfo? list;
|
|
List<ArticleListItemModel>? articles;
|
|
Owner? author;
|
|
Last? last;
|
|
bool? attention;
|
|
|
|
ArticleListData({
|
|
this.list,
|
|
this.articles,
|
|
this.author,
|
|
this.last,
|
|
this.attention,
|
|
});
|
|
|
|
factory ArticleListData.fromJson(Map<String, dynamic> json) =>
|
|
ArticleListData(
|
|
list: json['list'] == null
|
|
? null
|
|
: ArticleListInfo.fromJson(json['list'] as Map<String, dynamic>),
|
|
articles: (json['articles'] as List<dynamic>?)
|
|
?.map(
|
|
(e) => ArticleListItemModel.fromJson(e as Map<String, dynamic>),
|
|
)
|
|
.toList(),
|
|
author: json['author'] == null
|
|
? null
|
|
: Owner.fromJson(json['author'] as Map<String, dynamic>),
|
|
last: json['last'] == null
|
|
? null
|
|
: Last.fromJson(json['last'] as Map<String, dynamic>),
|
|
attention: json['attention'] as bool?,
|
|
);
|
|
}
|