callAsyncJavaScript method
Invokes an asynchronous JavaScript function and waits for its result.
arguments are exposed as named local variables in functionBody. Only
recursively JSON-compatible values are accepted. A JavaScript throw or
rejected promise completes with JavaScriptExecutionException.
Implementation
Future<Object?> callAsyncJavaScript(
String functionBody, {
Map<String, Object?> arguments = const <String, Object?>{},
Duration timeout = const Duration(seconds: 30),
}) {
return platform.callAsyncJavaScript(
JavaScriptInvocationParams(
functionBody: functionBody,
arguments: arguments,
timeout: timeout,
),
);
}