Browse Source

Update readme with details on additional params on WebviewScaffold

Jason Scott 7 years ago
parent
commit
3492d53b5a
1 changed files with 32 additions and 0 deletions
  1. 32 0
      README.md

+ 32 - 0
README.md

@@ -30,6 +30,38 @@ new MaterialApp(
     );
     );
 ```
 ```
 
 
+Optional parameters `hidden` and `initialChild` are available so that you can show something else while waiting for the page to load.
+If you set `hidden` to true it will show a default CircularProgressIndicator. If you additionally specify a Widget for initialChild
+you can have it display whatever you like till page-load.
+
+e.g. The following will show a read screen with the text 'waiting.....'.
+```dart
+return new MaterialApp(
+  title: 'Flutter WebView Demo',
+  theme: new ThemeData(
+    primarySwatch: Colors.blue,
+  ),
+  routes: {
+    '/': (_) => const MyHomePage(title: 'Flutter WebView Demo'),
+    '/widget': (_) => new WebviewScaffold(
+          url: selectedUrl,
+          appBar: new AppBar(
+            title: const Text('Widget webview'),
+          ),
+          withZoom: true,
+          withLocalStorage: true,
+          hidden: true,
+          initialChild: Container(
+            color: Colors.redAccent,
+            child: const Center(
+              child: Text('Waiting.....'),
+            ),
+          ),
+        )
+  },
+);
+```
+
 `FlutterWebviewPlugin` provide a singleton instance linked to one unique webview,
 `FlutterWebviewPlugin` provide a singleton instance linked to one unique webview,
 so you can take control of the webview from anywhere in the app
 so you can take control of the webview from anywhere in the app