Skip to content

Commit f3a83f3

Browse files
committed
Update readme with details on additional params on WebviewScaffold
1 parent b34d6bd commit f3a83f3

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff 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,
3466
so you can take control of the webview from anywhere in the app
3567

0 commit comments

Comments
 (0)