allLocales static method
All available locales in the tool.
Implementation
static List<Locale> allLocales(BuildContext context) {
if (!_isEnabled(context)) {
return defaultAvailableLocales.map((e) => Locale(e.code)).toList();
}
final store = Provider.of<DevicePreviewStore>(context);
return store.state
.maybeMap(
initialized: (state) => state.locales,
orElse: () => defaultAvailableLocales,
)
.map((e) => Locale(e.code))
.toList();
}