changeLocale method

Future<bool> changeLocale(
  1. Locale? locale
)

Explicitly change the app's locale.

Implementation

Future<bool> changeLocale(Locale? locale) async {
  bool change = locale != null;
  if (change) {
    change = await App.saveLocale(locale);
    if (change) {
      // Reflect the change by rebuilding the app.
      App.setState(() {});
    }
  }
  return change;
}