fix parse dyn

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-06-13 12:29:36 +08:00
parent 3fae4ef632
commit 2536350ccf

View File

@@ -422,7 +422,9 @@ class ModuleAuthorModel extends Avatar {
}
pubAction = json['pub_action'];
pubTime = json['pub_time'];
pubTs = json['pub_ts'] == 0 ? null : safeToInt(json['pub_ts']);
if (safeToInt(json['pub_ts']) case final pubTs? when pubTs > 0) {
this.pubTs = pubTs;
}
type = json['type'];
if (PendantAvatar.showDecorate) {
decorate = json['decorate'] == null
@@ -1340,7 +1342,9 @@ class DynamicStat {
bool? status;
DynamicStat.fromJson(Map<String, dynamic> json) {
count = json['count'] == 0 ? null : safeToInt(json['count']);
if (safeToInt(json['count']) case final count? when count > 0) {
this.count = count;
}
status = json['status'];
}
}