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

[webview_flutter] Resolve _CastError thrown by example app. #4390

Merged
merged 2 commits 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/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.1.1

* Fixed `_CastError` that was thrown when running the example App.

## 2.1.0

* Migrated to fully federated architecture.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,15 @@ class NavigationControls extends StatelessWidget {
(BuildContext context, AsyncSnapshot<WebViewController> snapshot) {
final bool webViewReady =
snapshot.connectionState == ConnectionState.done;
final WebViewController controller = snapshot.data!;
final WebViewController? controller = snapshot.data;
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 @@ -326,7 +326,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 @@ -343,7 +343,7 @@ class NavigationControls extends StatelessWidget {
onPressed: !webViewReady
? null
: () {
controller.reload();
controller!.reload();
},
),
],
Expand Down
2 changes: 1 addition & 1 deletion packages/webview_flutter/webview_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: webview_flutter
description: A Flutter plugin that provides a WebView widget on Android and iOS.
repository: https://github.com/flutter/plugins/tree/master/packages/webview_flutter/webview_flutter
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22
version: 2.1.0
version: 2.1.1

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