supportedLocales property

List<Locale>? get supportedLocales

getter, supportedLocales, returns a List of the App's locales. More flexible than an iteration.

Implementation

List<Locale>? get supportedLocales =>
    appState?.supportedLocales ??= L10n.supportedLocales;
set supportedLocales (List<Locale>? locales)

Implementation

set supportedLocales(List<Locale>? locales) {
  if (locales != null) {
    if (L10n.supportedLocales.isEmpty) {
      L10n.supportedLocales = appState?.supportedLocales ??= locales;
    } else {
      final appLocales = appState?.supportedLocales ?? [];
      if (appLocales.isEmpty) {
        // Note v.L10n.supportedLocales precedes locales
        appState?.supportedLocales?.addAll(L10n.supportedLocales);
      }
    }
  }
}