How to show "You're offline" when web view app open without internet in Flutter Web view App?


I create a WebView app in Flutter. But when the App open without internet its showing this
enter image description here

I want to show here another image when open this app without internet.
like redirecting to a page like your not connected or something How do I do that?


You can use this Package For checking Internet connection is available or not.

bool result = await DataConnectionChecker().hasConnection;

 return Scaffold(
      body: WebView(
        if (result == true) {
        initialUrl: "",
        onWebViewCreated: (WebViewController webViewController){
          //i am not connected to any network
      ) );

Answered By – Shailandra Rajput

Answer Checked By – Candace Johnson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *