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',
),
);