deviceLocale property

Locale? deviceLocale

Intended to store the device's original Locale.

Implementation

static Locale? get deviceLocale {
  if (_deviceLocale == null) {
    // The full system-reported supported locales of the device.
    final systemLocales = WidgetsBinding.instance.platformDispatcher.locales;
    // Determine the device's default Locale. Assume the first will do it.
    _deviceLocale ??= systemLocales.isNotEmpty ? systemLocales.first : null;
  }
  return _deviceLocale;
}