didChangeLocales method

  1. @override
Future<void> didChangeLocales(
  1. List<Locale>? locales
)
override

Called when the system tells the app that the user's locale has changed. For example, if the user changes the system language settings.

This method exposes notifications from dart:ui.PlatformDispatcher.onLocaleChanged.

Implementation

@override
Future<void> didChangeLocales(List<Locale>? locales) async {
  Get.asap(() {
    final Locale? locale = Get.deviceLocale;
    if (locale != null) {
      Get.updateLocale(locale);
    }
  });
}