How to show AlertDialog over WebviewScaffold in Flutter?

2k Views Asked by At

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.

1

There are 1 best solutions below

0
Andy Anderson Mbwale On

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() ;