locale property
Implementation
Locale? get locale =>
_locale ??
Localizations.maybeLocaleOf(context) ??
_resolveLocales(
// The full system-reported supported locales of the device.
WidgetsBinding.instance.platformDispatcher.locales,
supportedLocales,
);
Implementation
set locale(Locale? locale) {
if (locale != null &&
(_supportedLocales.isEmpty || _supportedLocales.contains(locale))) {
_locale = locale;
L10n.locale = locale; // Ensure L10n is updated
}
}