init static method

Future init(
  1. List<String> localeNames
)

Implementation

static Future init(List<String> localeNames) async {
  try {
    supportedLocales = localeNames.map((n) => Locale(n)).toList();
    final pref = await PreferenceUtils.init();
    log('prefLocale: ${pref.locale}');
    Locales.selectedLocale = pref.locale ?? supportedLocales.first;
  } catch (e) {
    log('error while loading locale: $e');
  }
}