I/flutter ( 4941): The getter 'openAppDrawerTooltip' was called on null.
I/flutter ( 4941): Receiver: null
I/flutter ( 4941): Tried calling: openAppDrawerTooltip
I/flutter ( 4941): Another exception was thrown: NoSuchMethodError: The getter 'openAppDrawerTooltip' was called on null.
I/flutter ( 4941): Another exception was thrown: NoSuchMethodError: The getter 'signedInLabel' was called on null.
切换到马来语时为什么会出现此错误?
我支持的语言是
`static Iterable<Locale> get supportedLocales => [
const Locale('en', 'US'),
const Locale('ms', 'MY'),
const Locale('zh', 'CN'),
];`
答案 0 :(得分:0)
Malasia尚不支持
支持的语言
/// * ar - Arabic /// * de - German /// * en - English /// * es - Spanish /// * fa - Farsi /// * fr - French /// * he - Hebrew /// * id - Indonesian /// * it - Italian /// * ja - Japanese /// * ko - Korean /// * ms - Malay /// * nl - Dutch /// * no - Norwegian /// * pl - Polish /// * ps - Pashto /// * pt - Portuguese /// * ro - Romanian /// * ru - Russian /// * th - Thai /// * tr - Turkish /// * ur - Urdu /// * vi - Vietnamese /// * zh - Simplified Chinese
另见https://github.com/flutter/flutter/tree/master/packages/flutter_localizations/lib/src/l10n
https://github.com/flutter/flutter/pull/12645显示了如何添加自定义本地化的示例
class PolishLocalizationsDelegate extends LocalizationsDelegate<MaterialLocalizations> { const PolishLocalizationsDelegate(); @override bool isSupported(Locale locale) => locale.languageCode == 'pl'; @override Future<MaterialLocalizations> load(Locale locale) => MyPolishMaterialLocalizations.load(locale); @override bool shouldReload(PolishLocalizationsDelegate old) => false; }
new MaterialApp( localizationsDelegates: [ const PolishLocalizationsDelegate(), GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, ], supportedLocales: [ const Locale('pl', 'PL'), // .. the other supported locales here ] )