Procházet zdrojové kódy

Update readme with details on additional params on WebviewScaffold

Jason Scott před 7 roky
rodič
revize
3492d53b5a
1 změnil soubory, kde provedl 32 přidání a 0 odebrání
  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