connectEVM method

Future<NetworkParams?> connectEVM(
  1. NetworkParams node
)

Implementation

Future<NetworkParams?> connectEVM(NetworkParams node) async {
  final Map? res =
      await (evalJavascript('eth.settings.connect("${node.endpoint}")'));
  if (res != null) {
    if (_webViewOOMReload) {
      print(
          "webView OOM Reload evaluateJavascript====\n${_msgJavascript.keys.toString()}");
      _msgJavascript.forEach((key, value) {
        _web!.webViewController.evaluateJavascript(source: value);
      });
      _msgJavascript = {};
      _webViewOOMReload = false;
    }
    node.chainId = res['chainId'].toString();
    return node;
  }
  return null;
}