diff --git a/cw_core/lib/node.dart b/cw_core/lib/node.dart index 9cf289090..1f2cfe7d2 100644 --- a/cw_core/lib/node.dart +++ b/cw_core/lib/node.dart @@ -29,10 +29,9 @@ class Node extends HiveObject with Keyable { Node.fromMap(Map map) : uriRaw = map['uri'] as String? ?? '', - login = map['login'] as String, - password = map['password'] as String, - typeRaw = map['typeRaw'] as int, - useSSL = map['useSSL'] as bool; + login = map['login'] as String?, + password = map['password'] as String?, + useSSL = map['useSSL'] as bool?; static const typeId = 1; static const boxName = 'Nodes'; diff --git a/lib/entities/node_list.dart b/lib/entities/node_list.dart index 9abde7076..58847ccfa 100644 --- a/lib/entities/node_list.dart +++ b/lib/entities/node_list.dart @@ -11,7 +11,7 @@ Future> loadDefaultNodes() async { for (final raw in loadedNodes) { if (raw is Map) { - final node = Node.fromMap(raw as Map); + final node = Node.fromMap(Map.from(raw)); node.type = WalletType.monero; nodes.add(node); } @@ -28,7 +28,7 @@ Future> loadBitcoinElectrumServerList() async { for (final raw in loadedServerList) { if (raw is Map) { - final node = Node.fromMap(raw as Map); + final node = Node.fromMap(Map.from(raw)); node.type = WalletType.bitcoin; serverList.add(node); } @@ -45,7 +45,7 @@ Future> loadLitecoinElectrumServerList() async { for (final raw in loadedServerList) { if (raw is Map) { - final node = Node.fromMap(raw as Map); + final node = Node.fromMap(Map.from(raw)); node.type = WalletType.litecoin; serverList.add(node); } @@ -61,7 +61,7 @@ Future> loadDefaultHavenNodes() async { for (final raw in loadedNodes) { if (raw is Map) { - final node = Node.fromMap(raw as Map); + final node = Node.fromMap(Map.from(raw)); node.type = WalletType.haven; nodes.add(node); }