Why is Flutter WebView not loading page?
1,385
Solution 1
This code work for me. Try this out
return Scaffold(
appBar: AppBar(
title: Text('test'),
),
body: Column(
children: [
RaisedButton(
onPressed: () {},
child: Text('Test'),
),
Expanded(
child: WebView(
initialUrl: 'https://flutter.dev',
javascriptMode: JavascriptMode.unrestricted,
),
),
],
),
);
Solution 2
******Give Internet Permission in Android Manifest.xml file and the permission is below
https://stackoverflow.com/questions/55603979/why-cant-a-flutter-application-connect-to-the-internet-when-installing-app-rel
<manifest xmlns:android="...">
<uses-permission android:name="android.permission.INTERNET"/>
</manifast>
Author by
Noor
Love programming, designing system, their architectures, fond of client side web programming using javascript frameworks such as angularjs, emberjs or other like GWT
Updated on January 01, 2023Comments
-
Noor over 1 year
I am making a simple screen containing a WebView encapsulated inside a Scaffold. There is a button above the WebView. The WebView is not loading the page. However, when the WebView is not encapsulated inside the Scaffold, the page loads. I need to have the Scaffold as a container to add other widgets. How to make the WebView loads its page inside the Scaffold.
Codes containing WebView inside Scaffold. WebView does not load
return MaterialApp( home: Scaffold( body: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ TextButton( onPressed: () { }, child: Text('Print page'), ), WebView( initialUrl: 'https://flutter.dev', ) ],),), );
Codes containing only WebView. WebView does not load
return MaterialApp( home: WebView( initialUrl: 'https://flutter.dev', ), );
-
Ankit Tale over 2 yearsif you are using the Flutter community Plugin of Webview. Then you need to use WebViewScaffold. Please check this medium link medium.com/@zeyadelosherey/…
-
-
Saif Khan over 2 years