How to show AlertDialog over WebviewScaffold in Flutter?
1,616
You can use the hide method to hide the webview whenever you want to display the dialog.
Code:
final FlutterWebviewPlugin webviewPlugin = new FlutterWebviewPlugin() ;
// when displaying the dialog
webviewPlugin. hide() ;
Author by
Sagar Zala
Contact me: Mail : [email protected] Skype : sagar_zala LinkedIn : Click Here. Best Practices: Either sleep or code Bad mood? Take a break PROUD TO BE INDIAN
Updated on December 01, 2022Comments
-
Sagar Zala 2 daysI am going to open
AlertDialogoverWebviewScaffoldbut it not shown. When I open theAlertDialog, it was appear under theWebviewScaffold.Below is my code,
child: Container( child: WebviewScaffold( url: agreementURL, withZoom: false, withLocalStorage: false, hidden: true, withJavascript: true, ), ),When internet is not available I will show the
AlertDialogbut dialog appear under theWebviewScaffold.Thanks.
-
Doc over 3 yearsThe webview is not integrated in the widget tree, it is a native view on top of the flutter view. you won't be able to use snackbars, dialogs. -
Sagar Zala over 3 yearsOk thanks for comment.
-