Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Prev Previous commit
Next Next commit
Fixes
  • Loading branch information
Emmanuel Garcia committed Dec 17, 2020
commit 437a2d317766c1283f288d81c04edddf8cdfa477
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.


// TODO(amirh): Remove this once flutter_driver supports null safety.
// https://github.com/flutter/flutter/issues/71379
// @dart = 2.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// @dart = 2.9

import 'dart:async';
import 'dart:convert';
import 'dart:io';
Expand Down Expand Up @@ -416,7 +418,8 @@ void main() {
expect(isPaused, _webviewBool(true));
});

testWidgets('Changes to initialMediaPlaybackPolicy are ignored', (WidgetTester tester) async {
testWidgets('Changes to initialMediaPlaybackPolicy are ignored',
(WidgetTester tester) async {
final Completer<WebViewController> controllerCompleter =
Completer<WebViewController>();
Completer<void> pageLoaded = Completer<void>();
Expand Down Expand Up @@ -474,7 +477,8 @@ void main() {
expect(isPaused, _webviewBool(false));
});

testWidgets('Video plays inline when allowsInlineMediaPlayback is true', (WidgetTester tester) async {
testWidgets('Video plays inline when allowsInlineMediaPlayback is true',
(WidgetTester tester) async {
Completer<WebViewController> controllerCompleter =
Completer<WebViewController>();
Completer<void> pageLoaded = Completer<void>();
Expand Down
16 changes: 8 additions & 8 deletions packages/webview_flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class _WebViewExampleState extends State<WebViewExample> {
if (controller.hasData) {
return FloatingActionButton(
onPressed: () async {
final String url = await controller.data.currentUrl();
final String url = (await controller.data!.currentUrl())!;
// ignore: deprecated_member_use
Scaffold.of(context).showSnackBar(
SnackBar(content: Text('Favorited $url')),
Expand Down Expand Up @@ -145,25 +145,25 @@ class SampleMenu extends StatelessWidget {
onSelected: (MenuOptions value) {
switch (value) {
case MenuOptions.showUserAgent:
_onShowUserAgent(controller.data, context);
_onShowUserAgent(controller.data!, context);
break;
case MenuOptions.listCookies:
_onListCookies(controller.data, context);
_onListCookies(controller.data!, context);
break;
case MenuOptions.clearCookies:
_onClearCookies(context);
break;
case MenuOptions.addToCache:
_onAddToCache(controller.data, context);
_onAddToCache(controller.data!, context);
break;
case MenuOptions.listCache:
_onListCache(controller.data, context);
_onListCache(controller.data!, context);
break;
case MenuOptions.clearCache:
_onClearCache(controller.data, context);
_onClearCache(controller.data!, context);
break;
case MenuOptions.navigationDelegate:
_onNavigationDelegateExample(controller.data, context);
_onNavigationDelegateExample(controller.data!, context);
break;
}
},
Expand Down Expand Up @@ -299,7 +299,7 @@ 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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// @dart = 2.9

import 'dart:async';
import 'dart:convert';
import 'dart:io';
Expand Down