网络文章-v1

This commit is contained in:
toly
2023-05-17 09:18:42 +08:00
parent f1b902ab58
commit 5c706fb9ae
13 changed files with 286 additions and 51 deletions

View File

@@ -0,0 +1,24 @@
class Article {
final String title;
final String url;
final String time;
const Article({
required this.title,
required this.time,
required this.url,
});
factory Article.formMap(dynamic json) {
return Article(
title: json['title'] ?? '未知',
url: json['link'] ?? '',
time: json['niceDate'] ?? '',
);
}
@override
String toString() {
return 'Article{title: $title, url: $url, time: $time}';
}
}