locale property

Locale? get locale
inherited

Implementation

Locale? get locale =>
    _locale ??
    Localizations.maybeLocaleOf(context) ??
    _resolveLocales(
      // The full system-reported supported locales of the device.
      WidgetsBinding.instance.platformDispatcher.locales,
      supportedLocales,
    );
set locale (Locale? locale)
inherited

Implementation

set locale(Locale? locale) {
  if (locale != null &&
      (_supportedLocales.isEmpty || _supportedLocales.contains(locale))) {
    _locale = locale;
    L10n.locale = locale; // Ensure L10n is updated
  }
}