setCurrentLocale method

void setCurrentLocale(
  1. Locale locale
)

Pass locale to set the locale for the current device.

localeを渡して現在のデバイスのロケールを設定します。

Implementation

void setCurrentLocale(Locale locale) {
  if (!supportedLocales().contains(locale)) {
    throw UnsupportedError("This Locale is not supported: $locale");
  }
  if (_locale != locale) {
    _locale = locale;
    notifyListeners();
  }
}