setLocaleRaw method

Future<E> setLocaleRaw(
  1. String rawLocale, {
  2. bool? listenToDeviceLocale = false,
})

Sets locale using string tag (e.g. en_US, de-DE, fr) Fallbacks to base locale. Returns the locale which has been set.

Locale gets changed automatically if listenToDeviceLocale is true and TranslationProvider is used. If null, then the last state is used. By default, calling this method disables the listener.

Implementation

Future<E> setLocaleRaw(
  String rawLocale, {
  bool? listenToDeviceLocale = false,
}) async {
  final E locale = utils.parse(rawLocale);
  return await setLocale(locale, listenToDeviceLocale: listenToDeviceLocale);
}