File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
packages/webview_flutter/webview_flutter/lib Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -370,6 +370,30 @@ class WebViewController {
370
370
return platform.setOnConsoleMessage (onConsoleMessage);
371
371
}
372
372
373
+ /// Sets a callback that notifies the host application that the web page
374
+ /// wants to display a JavaScript alert() dialog.
375
+ Future <void > setOnJavaScriptAlertDialog (
376
+ Future <void > Function (JavaScriptAlertDialogRequest request)
377
+ onJavaScriptAlertDialog) async {
378
+ return platform.setOnJavaScriptAlertDialog (onJavaScriptAlertDialog);
379
+ }
380
+
381
+ /// Sets a callback that notifies the host application that the web page
382
+ /// wants to display a JavaScript confirm() dialog.
383
+ Future <void > setOnJavaScriptConfirmDialog (
384
+ Future <bool > Function (JavaScriptConfirmDialogRequest request)
385
+ onJavaScriptConfirmDialog) async {
386
+ return platform.setOnJavaScriptConfirmDialog (onJavaScriptConfirmDialog);
387
+ }
388
+
389
+ /// Sets a callback that notifies the host application that the web page
390
+ /// wants to display a JavaScript prompt() dialog.
391
+ Future <void > setOnJavaScriptTextInputDialog (
392
+ Future <String > Function (JavaScriptTextInputDialogRequest request)
393
+ onJavaScriptTextInputDialog) async {
394
+ return platform.setOnJavaScriptTextInputDialog (onJavaScriptTextInputDialog);
395
+ }
396
+
373
397
/// Gets the value used for the HTTP `User-Agent:` request header.
374
398
Future <String ?> getUserAgent () {
375
399
return platform.getUserAgent ();
Original file line number Diff line number Diff line change 4
4
5
5
export 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart'
6
6
show
7
+ JavaScriptAlertDialogRequest,
8
+ JavaScriptConfirmDialogRequest,
7
9
JavaScriptConsoleMessage,
8
10
JavaScriptLogLevel,
9
11
JavaScriptMessage,
10
12
JavaScriptMode,
13
+ JavaScriptTextInputDialogRequest,
11
14
LoadRequestMethod,
12
15
NavigationDecision,
13
16
NavigationRequest,
You can’t perform that action at this time.
0 commit comments