Unverified Commit 2d836a99 authored by Greg Spencer's avatar Greg Spencer Committed by GitHub

Remove some unnecessary casts, now that changes have rolled from the engine (#70491)

parent 6e84a142
...@@ -689,11 +689,8 @@ void main() { ...@@ -689,11 +689,8 @@ void main() {
const OnlyRTLDefaultWidgetsLocalizationsDelegate(), const OnlyRTLDefaultWidgetsLocalizationsDelegate(),
], ],
buildContent: (BuildContext context) { buildContent: (BuildContext context) {
// TODO(gspencergood): remove the casts once final Locale locale1 = ui.window.locales.first;
// https://github.com/flutter/engine/pull/22473 rolls into the final Locale locale2 = ui.window.locales[1];
// framework.
final Locale locale1 = ((ui.window.locales as dynamic) as List<Locale>).first;
final Locale locale2 = ((ui.window.locales as dynamic) as List<Locale>)[1];
return Text('$locale1 $locale2'); return Text('$locale1 $locale2');
}, },
) )
......
...@@ -154,8 +154,7 @@ class TestWindow implements ui.SingletonFlutterWindow { ...@@ -154,8 +154,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
} }
@override @override
// TODO(gspencergoog): remove the casts once https://github.com/flutter/engine/pull/22267 lands ui.Locale get locale => _localeTestValue ?? platformDispatcher.locale;
ui.Locale get locale => _localeTestValue ?? ((platformDispatcher.locale as dynamic) as ui.Locale);
ui.Locale? _localeTestValue; ui.Locale? _localeTestValue;
/// Hides the real locale and reports the given [localeTestValue] instead. /// Hides the real locale and reports the given [localeTestValue] instead.
set localeTestValue(ui.Locale localeTestValue) { set localeTestValue(ui.Locale localeTestValue) {
...@@ -169,8 +168,7 @@ class TestWindow implements ui.SingletonFlutterWindow { ...@@ -169,8 +168,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
} }
@override @override
// TODO(gspencergoog): remove the casts once https://github.com/flutter/engine/pull/22267 lands List<ui.Locale> get locales => _localesTestValue ?? platformDispatcher.locales;
List<ui.Locale> get locales => _localesTestValue ?? ((platformDispatcher.locales as dynamic) as List<ui.Locale>);
List<ui.Locale>? _localesTestValue; List<ui.Locale>? _localesTestValue;
/// Hides the real locales and reports the given [localesTestValue] instead. /// Hides the real locales and reports the given [localesTestValue] instead.
set localesTestValue(List<ui.Locale> localesTestValue) { set localesTestValue(List<ui.Locale> localesTestValue) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment