jsCall<T> method

Future jsCall<T>(
  1. String executeJs
)

Implementation

Future<dynamic> jsCall<T>(String executeJs) async {
  try {
    if (!jsApiReady.isCompleted){
      await jsApiReady.future;
    }
    dynamic res = await _controller.runJavaScriptReturningResult(executeJs);
    return T == bool ? resolveBooleanValue(res) : res;
  } catch (e) {
    print('JS LOST ctrl ERROR=${e.toString()}');
    if (this.onJsConnectionError != null) {
      this.onJsConnectionError!();
    }
    throw e;
  }
  return null;
}