CAKE-169 | added useSSL parameter to node.dart and to node_create_or_edit_view_model.dart; applied useSSL parameter in the connectToNode() method (monero_wallet.dart) and in the save() method (node_create_or_edit_view_model.dart); created standard_checkbox.dart and applied StandardCheckbox widget in the node_create_or_edit_page.dart

This commit is contained in:
OleksandrSobol
2020-11-30 19:05:49 +02:00
parent 83fea0e9d3
commit 5ee278237f
5 changed files with 110 additions and 7 deletions
@@ -14,7 +14,8 @@ class NodeCreateOrEditViewModel = NodeCreateOrEditViewModelBase
abstract class NodeCreateOrEditViewModelBase with Store {
NodeCreateOrEditViewModelBase(this._nodeSource, this._wallet)
: state = InitialExecutionState(),
connectionState = InitialConnectionState();
connectionState = InitialConnectionState(),
useSSL = false;
@observable
ExecutionState state;
@@ -34,6 +35,9 @@ abstract class NodeCreateOrEditViewModelBase with Store {
@observable
ConnectionToNodeState connectionState;
@observable
bool useSSL;
@computed
bool get isReady =>
(address?.isNotEmpty ?? false) && (port?.isNotEmpty ?? false);
@@ -59,6 +63,7 @@ abstract class NodeCreateOrEditViewModelBase with Store {
port = '';
login = '';
password = '';
useSSL = false;
}
@action
@@ -66,7 +71,8 @@ abstract class NodeCreateOrEditViewModelBase with Store {
try {
state = IsExecutingState();
final node =
Node(uri: uri, type: _wallet.type, login: login, password: password);
Node(uri: uri, type: _wallet.type, login: login, password: password,
useSSL: useSSL);
await _nodeSource.add(node);
state = ExecutedSuccessfullyState();
} catch (e) {