webViewMessageHandler static method
A ready-made JavaScript handler callback for the WebView message channel.
Pass this as the callback of flutter_inappwebview's
addJavaScriptHandler, registered under webViewMessageHandlerName.
The first argument is the command message; anything else is rejected
with an error response. This never throws.
Implementation
static Future<String> webViewMessageHandler(List<dynamic> args) {
final Object? message = args.isEmpty ? null : args.first;
return handleWebViewMessage(message is String ? message : null);
}