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