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

[webview_flutter_android] Load example App's navigation controls immediately. #4377

Merged
merged 1 commit into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/webview_flutter/webview_flutter_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.14

* 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).

## 2.0.13

* Extract Android implementation from `webview_flutter`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,15 @@ class _NavigationControls extends StatelessWidget {
final bool webViewReady =
snapshot.connectionState == ConnectionState.done;
final WebViewController? controller = snapshot.data;
if (controller == null) return Container();

return Row(
children: <Widget>[
IconButton(
icon: const Icon(Icons.arrow_back_ios),
onPressed: !webViewReady
? null
: () async {
if (await controller.canGoBack()) {
if (await controller!.canGoBack()) {
await controller.goBack();
} else {
// ignore: deprecated_member_use
Expand All @@ -313,7 +313,7 @@ class _NavigationControls extends StatelessWidget {
onPressed: !webViewReady
? null
: () async {
if (await controller.canGoForward()) {
if (await controller!.canGoForward()) {
await controller.goForward();
} else {
// ignore: deprecated_member_use
Expand All @@ -330,7 +330,7 @@ class _NavigationControls extends StatelessWidget {
onPressed: !webViewReady
? null
: () {
controller.reload();
controller!.reload();
},
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: webview_flutter_android
description: A Flutter plugin that provides a WebView widget on Android.
repository: https://github.com/flutter/plugins/tree/master/packages/webview_flutter/webview_flutter_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22
version: 2.0.13
version: 2.0.14

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down