assetPickerTextDelegateFromLocale function
Obtain the text delegate from the given locale.
Implementation
AssetPickerTextDelegate assetPickerTextDelegateFromLocale(Locale? locale) {
if (locale == null) {
return const AssetPickerTextDelegate();
}
final String languageCode = locale.languageCode.toLowerCase();
for (final AssetPickerTextDelegate delegate in assetPickerTextDelegates) {
if (delegate.languageCode == languageCode) {
return delegate;
}
}
return const AssetPickerTextDelegate();
}