Unverified Commit a4651059 authored by Gary Qian's avatar Gary Qian Committed by GitHub

Null check in locale resolution (#23301)

parent 48fe65c2
......@@ -678,6 +678,9 @@ class _WidgetsAppState extends State<WidgetsApp> implements WidgetsBindingObserv
Locale _locale;
Locale _resolveLocale(Locale newLocale, Iterable<Locale> supportedLocales) {
if (newLocale == null) {
return supportedLocales.first;
}
if (widget.localeResolutionCallback != null) {
final Locale locale = widget.localeResolutionCallback(newLocale, widget.supportedLocales);
if (locale != null)
......
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