runJs method

Future<String?> runJs(
  1. String js
)

Implementation

Future<String?> runJs(String js) {
  final c = Completer<String?>();
  runZonedGuarded(() async {
    final runner = jsRunner;
    if (runner != null) {
      final re = await runner(js);
      c.complete(re);
    } else {
      debugPrint("js runner js null");
      c.complete();
    }
  }, (Object error, StackTrace stack) {
    debugPrint("run js error: $error");
    c.complete();
  });
  return c.future;
}