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() ;
Share:
1,616
Sagar Zala
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, 2022

Comments

  • Sagar Zala
    Sagar Zala 2 days

    I am going to open AlertDialog over WebviewScaffold but it not shown. When I open the AlertDialog, it was appear under the WebviewScaffold.

    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 AlertDialog but dialog appear under the WebviewScaffold.

    Thanks.

    • Doc
      Doc over 3 years
      The 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
      Sagar Zala over 3 years
      Ok thanks for comment.