changeToSystemLocale method

Future<LocalinoArgs> changeToSystemLocale({
  1. bool resetPreferred = false,
})

Changes localization to system preferred language.

getSystemLocale is used to get preferred locale. Returns result of localization change LocalinoArgs. Result of localization change is send to global broadcast with Localino key.

Implementation

Future<LocalinoArgs> changeToSystemLocale(
    {bool resetPreferred = false}) async {
  loading = true;

  final locale = getSystemLocale();

  if (resetPreferred) {
    resetPreferredLocale();
  }

  return await changeLocale(locale, preferred: false);
}