set default value to nullable field

Godwin Asuquo committed Dec 12, 2022 at 20:34 UTC 9ce6c6e01a279e3d1afb4a6f8eea6bdea1220c79
3 files changed +4 -4
cw_core/lib/node.dart
+2 -2
@@ -53,8 +53,8 @@ class Node extends HiveObject with Keyable {
53 @HiveField(4)
54 bool? useSSL;
55
56 - @HiveField(5)
57 - bool? trusted;
56 + @HiveField(5, defaultValue: false)
57 + bool trusted;
58
59 bool get isSSL => useSSL ?? false;
60
cw_haven/lib/haven_wallet.dart
+1 -1
@@ -122,7 +122,7 @@ abstract class HavenWalletBase extends WalletBase<MoneroBalance,
122 useSSL: node.useSSL ?? false,
123 isLightWallet: false); // FIXME: hardcoded value
124
125 - haven_wallet.setTrustedDaemon(node.trusted ?? false);
125 + haven_wallet.setTrustedDaemon(node.trusted);
126 syncStatus = ConnectedSyncStatus();
127 } catch (e) {
128 syncStatus = FailedSyncStatus();
cw_monero/lib/monero_wallet.dart
+1 -1
@@ -137,7 +137,7 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
137 useSSL: node.isSSL,
138 isLightWallet: false); // FIXME: hardcoded value
139
140 - monero_wallet.setTrustedDaemon(node.trusted ?? false);
140 + monero_wallet.setTrustedDaemon(node.trusted);
141 syncStatus = ConnectedSyncStatus();
142 } catch (e) {
143 syncStatus = FailedSyncStatus();