getCurrentLocale static method
Get the current system locale. Uses the context if available, otherwise falls back to platform dispatcher.
Implementation
static Locale getCurrentLocale({BuildContext? context}) {
if (context != null) {
return Localizations.localeOf(context);
}
return ui.PlatformDispatcher.instance.locale;
}