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

Commit 4470692

Browse files
authored
Fixed _CastError when running example App (#4390)
1 parent f48f8db commit 4470692

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

packages/webview_flutter/webview_flutter/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.1.1
2+
3+
* Fixed `_CastError` that was thrown when running the example App.
4+
15
## 2.1.0
26

37
* Migrated to fully federated architecture.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,15 +302,15 @@ class NavigationControls extends StatelessWidget {
302302
(BuildContext context, AsyncSnapshot<WebViewController> snapshot) {
303303
final bool webViewReady =
304304
snapshot.connectionState == ConnectionState.done;
305-
final WebViewController controller = snapshot.data!;
305+
final WebViewController? controller = snapshot.data;
306306
return Row(
307307
children: <Widget>[
308308
IconButton(
309309
icon: const Icon(Icons.arrow_back_ios),
310310
onPressed: !webViewReady
311311
? null
312312
: () async {
313-
if (await controller.canGoBack()) {
313+
if (await controller!.canGoBack()) {
314314
await controller.goBack();
315315
} else {
316316
// ignore: deprecated_member_use
@@ -326,7 +326,7 @@ class NavigationControls extends StatelessWidget {
326326
onPressed: !webViewReady
327327
? null
328328
: () async {
329-
if (await controller.canGoForward()) {
329+
if (await controller!.canGoForward()) {
330330
await controller.goForward();
331331
} else {
332332
// ignore: deprecated_member_use
@@ -343,7 +343,7 @@ class NavigationControls extends StatelessWidget {
343343
onPressed: !webViewReady
344344
? null
345345
: () {
346-
controller.reload();
346+
controller!.reload();
347347
},
348348
),
349349
],

packages/webview_flutter/webview_flutter/pubspec.yaml

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

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

0 commit comments

Comments
 (0)