0

当我使用 GetX 状态管理时,Flutter 默认本地化不起作用。它向我显示了一个错误,例如

Undefined name 'AppLocalizations'.
Try correcting the name to one that is defined, or defining the name.

在此处输入图像描述

我该如何解决这个问题?

4

1 回答 1

0

请在 pubspec.yaml 中添加这些依赖项

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  intl: ^0.17.0

更多信息在这里

于 2022-03-02T11:35:32.787 回答