Null check in locale resolution (#23301)
This commit is contained in:
parent
48fe65c236
commit
a46510598e
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user