99 - [x] Listen for Redirects
1010 - [x] Add buttons to a navigation bar
1111 - [x] Receive call backs for nav buttons pressed
12+ - [x] WebView loading callbacks
1213 - [x] Supports custom nav bar & button colors ( ios only for now )
1314 - [ ] Advanced nav bar support ( position , enable, disable buttons )
1415 - [ ] Support for nav bar icon buttons
@@ -26,3 +27,42 @@ To use on Android, make sure to add the the following in your AndroidManifest.xm
2627<activity android:name="com.apptreesoftware.flutterwebview.WebViewActivity">
2728</activity>
2829```
30+
31+ ### Example Usage
32+
33+ ```
34+ flutterWebView.launch(
35+ "https://apptreesoftware.com",
36+ headers: {
37+ "X-SOME-HEADER": "MyCustomHeader",
38+ },
39+ javaScriptEnabled: false,
40+ toolbarActions: [
41+ new ToolbarAction("Dismiss", 1),
42+ new ToolbarAction("Reload", 2)
43+ ],
44+ barColor: Colors.green,
45+ tintColor: Colors.white);
46+ flutterWebView.onToolbarAction.listen((identifier) {
47+ switch (identifier) {
48+ case 1:
49+ flutterWebView.dismiss();
50+ break;
51+ case 2:
52+ reload();
53+ break;
54+ }
55+ });
56+ flutterWebView.listenForRedirect("mobile://test.com", true);
57+
58+ flutterWebView.onWebViewDidStartLoading.listen((url) {
59+ setState(() => _isLoading = true);
60+ });
61+ flutterWebView.onWebViewDidLoad.listen((url) {
62+ setState(() => _isLoading = false);
63+ });
64+ flutterWebView.onRedirect.listen((url) {
65+ flutterWebView.dismiss();
66+ setState(() => _redirectedToUrl = url);
67+ });
68+ ```
0 commit comments