setLocale static method

AppLocale setLocale(
  1. AppLocale locale
)

Sets locale Returns the locale which has been set.

Implementation

static AppLocale setLocale(AppLocale locale) {
	_currLocale = locale;
	_t = _currLocale.translations;

	if (WidgetsBinding.instance != null) {
		// force rebuild if TranslationProvider is used
		_translationProviderKey.currentState?.setLocale(_currLocale);
	}

	return _currLocale;
}