onJsAlert method
Event fired when javascript calls the alert() method to display an alert dialog.
If JsAlertResponse.handledByClient is true, the webview will assume that the client will handle the dialog.
jsAlertRequest contains the message to be displayed in the alert dialog and the of the page requesting the dialog.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebChromeClient.onJsAlert)
- iOS WKWebView (Official API - WKUIDelegate.webView)
- macOS WKWebView (Official API - WKUIDelegate.webView)
Parameters - Officially Supported Platforms/Implementations:
jsAlertRequest: all platforms
Use the PlatformInAppBrowserEvents.isMethodSupported method to check if this method is supported at runtime.
Implementation
@override
FutureOr<JsAlertResponse?>? onJsAlert(JsAlertRequest jsAlertRequest) {
return null;
}