Issue
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. How do i do that?
Solution
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: "https://google.com/",
onWebViewCreated: (WebViewController webViewController){
_controller.complete(webViewController);
},}
else{
//i am not connected to any network
}
) );
Answered By - Shailandra Rajput
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.