This commit is contained in:
M
2020-06-01 21:56:21 +03:00
298 changed files with 9437 additions and 5461 deletions
@@ -12,6 +12,7 @@ class NodeListStore = NodeListBase with _$NodeListStore;
abstract class NodeListBase with Store {
NodeListBase({this.nodesSource}) {
nodes = ObservableList<Node>();
disabledState = true;
_onNodesChangeSubscription = nodesSource.watch().listen((e) => update());
update();
}
@@ -25,6 +26,9 @@ abstract class NodeListBase with Store {
@observable
String errorMessage;
@observable
bool disabledState;
Box<Node> nodesSource;
StreamSubscription<BoxEvent> _onNodesChangeSubscription;
@@ -61,6 +65,11 @@ abstract class NodeListBase with Store {
@action
Future reset() async => await resetToDefault(nodesSource);
@action
void setDisabledState(bool isDisable) {
disabledState = isDisable;
}
Future<bool> isNodeOnline(Node node) async {
try {
return await node.requestNode(node.uri,