Flutter upgrade

This commit is contained in:
M
2022-10-12 13:09:57 -04:00
parent c921ad890a
commit 1beb18b045
505 changed files with 6657 additions and 5875 deletions
@@ -14,7 +14,11 @@ abstract class NodeCreateOrEditViewModelBase with Store {
NodeCreateOrEditViewModelBase(this._nodeSource, this._wallet)
: state = InitialExecutionState(),
connectionState = InitialExecutionState(),
useSSL = false;
useSSL = false,
address = '',
port = '',
login = '',
password = '';
@observable
ExecutionState state;
@@ -39,7 +43,7 @@ abstract class NodeCreateOrEditViewModelBase with Store {
@computed
bool get isReady =>
(address?.isNotEmpty ?? false) && (port?.isNotEmpty ?? false);
address.isNotEmpty && port.isNotEmpty;
bool get hasAuthCredentials => _wallet.type == WalletType.monero ||
_wallet.type == WalletType.haven;
@@ -47,7 +51,7 @@ abstract class NodeCreateOrEditViewModelBase with Store {
String get uri {
var uri = address;
if (port != null && port.isNotEmpty) {
if (port.isNotEmpty) {
uri += ':' + port;
}
@@ -20,7 +20,15 @@ abstract class NodeListViewModelBase with Store {
}
@computed
Node get currentNode => settingsStore.nodes[wallet.type];
Node get currentNode {
final node = settingsStore.nodes[wallet.type];
if (node == null) {
throw Exception('No node for wallet type: ${wallet.type}');
}
return node;
}
final ObservableList<Node> nodes;
final SettingsStore settingsStore;
@@ -34,16 +42,16 @@ abstract class NodeListViewModelBase with Store {
switch (wallet.type) {
case WalletType.bitcoin:
node = getBitcoinDefaultElectrumServer(nodes: _nodeSource);
node = getBitcoinDefaultElectrumServer(nodes: _nodeSource)!;
break;
case WalletType.monero:
node = getMoneroDefaultNode(nodes: _nodeSource);
break;
case WalletType.litecoin:
node = getLitecoinDefaultElectrumServer(nodes: _nodeSource);
node = getLitecoinDefaultElectrumServer(nodes: _nodeSource)!;
break;
default:
break;
throw Exception('Unexpected wallet type: ${wallet.type}');
}
await setAsCurrent(node);