Warning: This application's locale, zh, is not supported by all of its localization delegates

发布时间:2022-02-04 20:47:02

提示错误内容如下:

The following message was thrown:
Warning: This application's locale, zh, is not supported by all of its localization delegates.

• A CupertinoLocalizations delegate that supports the zh locale was not found.

If the application is built using GlobalMaterialLocalizations.delegate, consider using GlobalMaterialLocalizations.delegates (plural) instead, as that will automatically declare the appropriate Cupertino localizations.


The declared supported locales for this app are: zh, en

See https://flutter.dev/tutorials/internationalization/ f

语言配置由

localizationsDelegates: const [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
      ],

改为

localizationsDelegates: const [
        GlobalMaterialLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
      ],

Card image cap
APP STORE
Card image cap
应用宝
Card image cap
小米
Card image cap
华为