mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 19:47:47 +08:00
fix: null
This commit is contained in:
@@ -143,7 +143,7 @@ class _ActivityPageState extends ConsumerState<ActivityPage>
|
|||||||
children: [
|
children: [
|
||||||
Text("开始时间:${timeago.format(ac.date!)}"),
|
Text("开始时间:${timeago.format(ac.date!)}"),
|
||||||
Text("大小:${(ac.size ?? 0).readableFileSize()}"),
|
Text("大小:${(ac.size ?? 0).readableFileSize()}"),
|
||||||
ac.seedRatio > 0
|
(ac.seedRatio??0) > 0
|
||||||
? Text("分享率:${ac.seedRatio}")
|
? Text("分享率:${ac.seedRatio}")
|
||||||
: SizedBox()
|
: SizedBox()
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -110,8 +110,8 @@ class Activity {
|
|||||||
final String? saved;
|
final String? saved;
|
||||||
final int? progress;
|
final int? progress;
|
||||||
final int? size;
|
final int? size;
|
||||||
final double seedRatio;
|
final double? seedRatio;
|
||||||
final double uploadProgress;
|
final double? uploadProgress;
|
||||||
|
|
||||||
factory Activity.fromJson(Map<String, dynamic> json) {
|
factory Activity.fromJson(Map<String, dynamic> json) {
|
||||||
return Activity(
|
return Activity(
|
||||||
@@ -119,14 +119,14 @@ class Activity {
|
|||||||
mediaId: json["media_id"],
|
mediaId: json["media_id"],
|
||||||
episodeId: json["episode_id"],
|
episodeId: json["episode_id"],
|
||||||
sourceTitle: json["source_title"],
|
sourceTitle: json["source_title"],
|
||||||
date: DateTime.tryParse(json["date"] ?? ""),
|
date: DateTime.tryParse(json["date"] ?? DateTime.now().toString()),
|
||||||
targetDir: json["target_dir"],
|
targetDir: json["target_dir"],
|
||||||
status: json["status"],
|
status: json["status"],
|
||||||
saved: json["saved"],
|
saved: json["saved"],
|
||||||
progress: json["progress"],
|
progress: json["progress"]??0,
|
||||||
seedRatio: json["seed_ratio"],
|
seedRatio: json["seed_ratio"]??0,
|
||||||
size: json["size"],
|
size: json["size"]??0,
|
||||||
uploadProgress: json["upload_progress"]);
|
uploadProgress: json["upload_progress"]??0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user