supportedLocales property

List<Locale> get supportedLocales

Supported Locales

Implementation

static List<Locale> get supportedLocales {
  // Assume it's supported.
  if (_supportedLocales.isEmpty || _supportedLocales.length == 1) {
    //
    final _locale = locale;
    // If not already there
    if (!_supportedLocales.contains(_locale)) {
      if (_translations.isNotEmpty && !_translations.keys.contains(_locale)) {
        _supportedLocales.add(_locale);
      }
    }
    // Loads only once.
    if (_translations.isNotEmpty) {
      // Record the app's translated Locales.
      _supportedLocales.addAll(_translations.keys);
    }
  }
  // _localesSupported = _supportedLocales;
  return _supportedLocales;
}
set supportedLocales (List<Locale>? locales)

Implementation

static set supportedLocales(List<Locale>? locales) {
  // Can only set once!
  if (locales != null && supportedLocales.isEmpty) {
    _supportedLocales.addAll(locales);
  }
}