callJsMethod abstract method

Future callJsMethod(
  1. String name,
  2. List params
)

This function allows you to call Javascript functions defined inside the webview.

Suppose we have a defined a function (using EmbeddedJsContent) as follows:

function someFunction(param) {
  return 'This is a ' + param;
}

Example call:

var resultFromJs = await callJsMethod('someFunction', ['test'])
print(resultFromJs); // prints "This is a test"

Implementation

Future<dynamic> callJsMethod(
  String name,
  List<dynamic> params,
);