Fix Platform channel errors in web tests (#70252)

This commit is contained in:
Greg Spencer 2020-11-12 10:24:07 -08:00 committed by GitHub
parent 0c79659900
commit 0937207f5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<ui.Locale> get locales => _localesTestValue ?? platformDispatcher.locales!;
// TODO(gspencergoog): remove the casts once https://github.com/flutter/engine/pull/22267 lands
List<ui.Locale> get locales => _localesTestValue ?? ((platformDispatcher.locales as dynamic) as List<ui.Locale>);
List<ui.Locale>? _localesTestValue;
/// Hides the real locales and reports the given [localesTestValue] instead.
set localesTestValue(List<ui.Locale> localesTestValue) {