File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,38 @@ new MaterialApp(
3030 );
3131```
3232
33+ Optional parameters ` hidden ` and ` initialChild ` are available so that you can show something else while waiting for the page to load.
34+ If you set ` hidden ` to true it will show a default CircularProgressIndicator. If you additionally specify a Widget for initialChild
35+ you can have it display whatever you like till page-load.
36+
37+ e.g. The following will show a read screen with the text 'waiting.....'.
38+ ``` dart
39+ return new MaterialApp(
40+ title: 'Flutter WebView Demo',
41+ theme: new ThemeData(
42+ primarySwatch: Colors.blue,
43+ ),
44+ routes: {
45+ '/': (_) => const MyHomePage(title: 'Flutter WebView Demo'),
46+ '/widget': (_) => new WebviewScaffold(
47+ url: selectedUrl,
48+ appBar: new AppBar(
49+ title: const Text('Widget webview'),
50+ ),
51+ withZoom: true,
52+ withLocalStorage: true,
53+ hidden: true,
54+ initialChild: Container(
55+ color: Colors.redAccent,
56+ child: const Center(
57+ child: Text('Waiting.....'),
58+ ),
59+ ),
60+ )
61+ },
62+ );
63+ ```
64+
3365` FlutterWebviewPlugin ` provide a singleton instance linked to one unique webview,
3466so you can take control of the webview from anywhere in the app
3567
You can’t perform that action at this time.
0 commit comments