localeListResolutionCallback property

LocaleListResolutionCallback? localeListResolutionCallback
final

This callback is responsible for choosing the app's locale when the app is started, and when the user changes the device's locale.

When a localeListResolutionCallback is provided, Flutter will first attempt to resolve the locale with the provided localeListResolutionCallback. If the callback or result is null, it will fallback to trying the localeResolutionCallback. If both localeResolutionCallback and localeListResolutionCallback are left null or fail to resolve (return null), basic fallback algorithm will be used.

The priority of each available fallback is:

  1. localeListResolutionCallback is attempted.
  2. localeResolutionCallback is attempted.
  3. Flutter's basic resolution algorithm, as described in supportedLocales, is attempted last.

Properly localized projects should provide a more advanced algorithm than the basic method from supportedLocales, as it does not implement a complete algorithm (such as the one defined in Unicode TR35) and is optimized for speed at the detriment of some uncommon edge-cases.

This callback is passed along to the WidgetsApp built by this widget.

Implementation

final LocaleListResolutionCallback? localeListResolutionCallback;