Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit be5c202

Browse files
committed
Load navigation controls immediately.
Make sure the navigation controls in the example App are loaded immediately but only enable when the WebViewController is available. This is the same behavior as in the example App from the main webview_flutter package.
1 parent 80b5d2e commit be5c202

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.0.14
2+
3+
* Update example App so navigation menu loads immediatly but only becomes available when `WebViewController` is available (same behavior as example App in webview_flutter package).
4+
15
## 2.0.13
26

37
* Extract WKWebView implementation from `webview_flutter`.

packages/webview_flutter/webview_flutter_wkwebview/example/lib/main.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,15 @@ class _NavigationControls extends StatelessWidget {
289289
final bool webViewReady =
290290
snapshot.connectionState == ConnectionState.done;
291291
final WebViewController? controller = snapshot.data;
292-
if (controller == null) return Container();
292+
293293
return Row(
294294
children: <Widget>[
295295
IconButton(
296296
icon: const Icon(Icons.arrow_back_ios),
297297
onPressed: !webViewReady
298298
? null
299299
: () async {
300-
if (await controller.canGoBack()) {
300+
if (await controller!.canGoBack()) {
301301
await controller.goBack();
302302
} else {
303303
// ignore: deprecated_member_use
@@ -313,7 +313,7 @@ class _NavigationControls extends StatelessWidget {
313313
onPressed: !webViewReady
314314
? null
315315
: () async {
316-
if (await controller.canGoForward()) {
316+
if (await controller!.canGoForward()) {
317317
await controller.goForward();
318318
} else {
319319
// ignore: deprecated_member_use
@@ -330,7 +330,7 @@ class _NavigationControls extends StatelessWidget {
330330
onPressed: !webViewReady
331331
? null
332332
: () {
333-
controller.reload();
333+
controller!.reload();
334334
},
335335
),
336336
],

packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: webview_flutter_wkwebview
22
description: A Flutter plugin that provides a WebView widget based on Apple's WKWebView control.
33
repository: https://github.com/flutter/plugins/tree/master/packages/webview_flutter/webview_flutter_wkwebview
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22
5-
version: 2.0.13
5+
version: 2.0.14
66

77
environment:
88
sdk: ">=2.14.0 <3.0.0"

0 commit comments

Comments
 (0)