setLocale static method

dynamic setLocale(
  1. BuildContext context,
  2. Locale newLocale
)

Sets a new locale

Implementation

static setLocale(final BuildContext context, final Locale newLocale) {
  final currentInstance = GoogleI18nLocalizations.of(context)!;
  currentInstance.locale = newLocale;
}