locales property
- @Deprecated('Use WidgetTester.platformDispatcher.locales instead. ' 'Deprecated to prepare for the upcoming multi-window support. ' 'This feature was deprecated after v3.9.0-0.1.pre.')
- @override
The full system-reported supported locales of the device.
Accessing this value returns the value contained in the
PlatformDispatcher singleton, so instead of getting it from here, you
should consider getting it from
WidgetsBinding.instance.platformDispatcher
instead (or, when
WidgetsBinding
isn't available, from PlatformDispatcher.instance). The
reason this value forwards to the PlatformDispatcher is to provide
convenience for applications that only use a single main window.
This establishes the language and formatting conventions that window should, if possible, use to render their user interface.
The list is ordered in order of priority, with lower-indexed locales being preferred over higher-indexed ones. The first element is the primary locale.
The onLocaleChanged callback is called whenever this value changes.
See also:
- WidgetsBindingObserver, for a mechanism at the widgets layer to observe when this value changes.
Implementation
@Deprecated(
'Use WidgetTester.platformDispatcher.locales instead. '
'Deprecated to prepare for the upcoming multi-window support. '
'This feature was deprecated after v3.9.0-0.1.pre.'
)
@override
List<Locale> get locales => platformDispatcher.locales;