diff --git a/packages/flutter_localizations/test/widgets_test.dart b/packages/flutter_localizations/test/widgets_test.dart index c0bad1483b..363fa65488 100644 --- a/packages/flutter_localizations/test/widgets_test.dart +++ b/packages/flutter_localizations/test/widgets_test.dart @@ -689,8 +689,11 @@ void main() { const OnlyRTLDefaultWidgetsLocalizationsDelegate(), ], buildContent: (BuildContext context) { - final Locale locale1 = ui.window.locales!.first; - final Locale locale2 = ui.window.locales![1]; + // 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]; return Text('$locale1 $locale2'); }, )