From 2d836a99b66ffbc6b8eac1eb1717ae287b05cc78 Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Fri, 13 Nov 2020 16:28:06 -0800 Subject: [PATCH] Remove some unnecessary casts, now that changes have rolled from the engine (#70491) --- packages/flutter_localizations/test/widgets_test.dart | 7 ++----- packages/flutter_test/lib/src/window.dart | 6 ++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/flutter_localizations/test/widgets_test.dart b/packages/flutter_localizations/test/widgets_test.dart index 363fa65488..c4ec2d1d9b 100644 --- a/packages/flutter_localizations/test/widgets_test.dart +++ b/packages/flutter_localizations/test/widgets_test.dart @@ -689,11 +689,8 @@ void main() { const OnlyRTLDefaultWidgetsLocalizationsDelegate(), ], buildContent: (BuildContext context) { - // TODO(gspencergood): remove the casts once - // https://github.com/flutter/engine/pull/22473 rolls into the - // framework. - final Locale locale1 = ((ui.window.locales as dynamic) as List).first; - final Locale locale2 = ((ui.window.locales as dynamic) as List)[1]; + final Locale locale1 = ui.window.locales.first; + final Locale locale2 = ui.window.locales[1]; return Text('$locale1 $locale2'); }, ) diff --git a/packages/flutter_test/lib/src/window.dart b/packages/flutter_test/lib/src/window.dart index 5d9381e1e2..500dd68eaf 100644 --- a/packages/flutter_test/lib/src/window.dart +++ b/packages/flutter_test/lib/src/window.dart @@ -154,8 +154,7 @@ class TestWindow implements ui.SingletonFlutterWindow { } @override - // 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 get locale => _localeTestValue ?? platformDispatcher.locale; ui.Locale? _localeTestValue; /// Hides the real locale and reports the given [localeTestValue] instead. set localeTestValue(ui.Locale localeTestValue) { @@ -169,8 +168,7 @@ class TestWindow implements ui.SingletonFlutterWindow { } @override - // 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 get locales => _localesTestValue ?? platformDispatcher.locales; List? _localesTestValue; /// Hides the real locales and reports the given [localesTestValue] instead. set localesTestValue(List localesTestValue) {