evaluateJavaScript method

  1. @override
Future<String?> evaluateJavaScript(
  1. String javaScript
)
override

evaluate JavaScript in the web view.

Implementation

@override
Future<String?> evaluateJavaScript(String javaScript) async {
  final dynamic result = await channel.invokeMethod("evaluateJavaScript", {
    "viewId": viewId,
    "javaScriptString": javaScript,
  });
  if (result is String || result == null) {
    return result;
  }
  return json.encode(result);
}