Sagar Zala
Sagar Zala

Reputation: 5134

How to show AlertDialog over WebviewScaffold in Flutter?

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.

Upvotes: 2

Views: 2187

Answers (1)

user10040152
user10040152

Reputation:

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

Upvotes: 2

Related Questions