From 0937207f5bba7202cafc40e09f1243b00d906bc9 Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Thu, 12 Nov 2020 10:24:07 -0800 Subject: [PATCH] Fix Platform channel errors in web tests (#70252) --- packages/flutter_test/lib/src/window.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/flutter_test/lib/src/window.dart b/packages/flutter_test/lib/src/window.dart index c946ef851f..5d9381e1e2 100644 --- a/packages/flutter_test/lib/src/window.dart +++ b/packages/flutter_test/lib/src/window.dart @@ -154,8 +154,8 @@ class TestWindow implements ui.SingletonFlutterWindow { } @override - // ignore: unnecessary_non_null_assertion - ui.Locale get locale => _localeTestValue ?? platformDispatcher.locale!; + // TODO(gspencergoog): remove the casts once https://github.com/flutter/engine/pull/22267 lands + ui.Locale get locale => _localeTestValue ?? ((platformDispatcher.locale as dynamic) as ui.Locale); ui.Locale? _localeTestValue; /// Hides the real locale and reports the given [localeTestValue] instead. set localeTestValue(ui.Locale localeTestValue) { @@ -169,8 +169,8 @@ class TestWindow implements ui.SingletonFlutterWindow { } @override - // ignore: unnecessary_non_null_assertion - List get locales => _localesTestValue ?? platformDispatcher.locales!; + // TODO(gspencergoog): remove the casts once https://github.com/flutter/engine/pull/22267 lands + List get locales => _localesTestValue ?? ((platformDispatcher.locales as dynamic) as List); List? _localesTestValue; /// Hides the real locales and reports the given [localesTestValue] instead. set localesTestValue(List localesTestValue) {