diff --git a/lib/api/apiRecovery.dart b/lib/api/apiRecovery.dart index 55ed6c104..1137a55c9 100644 --- a/lib/api/apiRecovery.dart +++ b/lib/api/apiRecovery.dart @@ -17,10 +17,11 @@ class ApiRecovery { return null; } - Future queryRecoverableList(List addresses) async { + Future> queryRecoverableList( + List addresses) async { final List res = await service.queryRecoverableList(addresses); return res - .map((e) => RecoveryInfo.fromJson(Map.of(e))) + .map((e) => RecoveryInfo.fromJson(Map.of(e ?? {}))) .toList(); } diff --git a/lib/api/types/recoveryInfo.dart b/lib/api/types/recoveryInfo.dart index d38547470..91b16a160 100644 --- a/lib/api/types/recoveryInfo.dart +++ b/lib/api/types/recoveryInfo.dart @@ -7,8 +7,8 @@ class RecoveryInfo extends _RecoveryInfo { info.address = json['address']; info.delayPeriod = json['delayPeriod']; info.threshold = json['threshold']; - info.friends = List.from(json['friends']); - info.deposit = BigInt.parse(json['deposit'].toString()); + info.friends = List.from(json['friends'] ?? []); + info.deposit = BigInt.parse((json['deposit'] ?? 0).toString()); return info; } } diff --git a/lib/plugin/store/balances.dart b/lib/plugin/store/balances.dart index 6876156d2..aa0f4cc56 100644 --- a/lib/plugin/store/balances.dart +++ b/lib/plugin/store/balances.dart @@ -43,6 +43,8 @@ class TokenBalanceData { this.symbol, this.decimals, this.amount, + this.locked, + this.reserved, this.detailPageRoute, }); @@ -50,6 +52,8 @@ class TokenBalanceData { final String symbol; final int decimals; final String amount; + final String locked; + final String reserved; final String detailPageRoute; }