reloadLocale function

dynamic reloadLocale(
  1. BuildContext context,
  2. Locale locale
)

Reloads the locale for the AppLocalizations class with a locale.

Implementation

reloadLocale(BuildContext context, Locale locale) async {
      AppLocalizations.of(context)!.locale = locale;
      await AppLocalizations.of(context)!.load();
}