【发布时间】:2021-02-03 02:14:45
【问题描述】:
我需要我的应用程序支持不同的语言。 但是我在使用 languageCode 属性时遇到了问题。 代码是:
supportedLocales: [
Locale('en', ''),
Locale('ar', ''),
],
localeListResolutionCallback: (currentLocale, supportedLocales) {
if (currentLocale != null) {
print(currentLocale.languageCode);
for(Locale locale in supportedLocales){
// if(currentLocale.languageCode== )
}
}
return supportedLocales.first;
},
问题是: 没有为类型“列表”定义吸气剂“语言代码”。 尝试导入定义“languageCode”的库,将名称更正为现有 getter 的名称,或定义名为“languageCode”的 getter 或字段。
【问题讨论】:
-
如果答案有帮助,您可以投票 :) stackoverflow.com/a/64442099/10659482
标签: flutter localization