isSupported method
判断本地语言是否支持
deviceLocale
当前设备语言
supportedLocals
设置的语言
Implementation
bool isSupported(Locale deviceLocale) {
var locales = supportedLocale;
if (locales.isEmptyList) {
return false;
}
bool flag = false;
locales.forEach((element) {
if (element.languageCode == deviceLocale.languageCode) {
flag = true;
return;
}
});
return flag;
}