locale property

Locale locale

The system-reported default locale of the device.

This establishes the language and formatting conventions that application should, if possible, use to render their user interface.

This is the first locale selected by the user and is the user's primary locale (the locale the device UI is displayed in)

This is equivalent to locales.first and will provide an empty non-null locale if the locales list has not been set or is empty.

Implementation

Locale get locale {
  if (_locales != null && _locales.isNotEmpty) {
    return _locales.first;
  }
  return null;
}