flutter pub get
3.2 Flutter Intl 初始化项目
Tool->Flutter Intl ->Initalize for the project
成功后,自动在 pubspec.yaml末尾增加
flutter_intl:
enabled: true
3.3 在lib下生成generated 和 l10n
执行Flutter Intl->Initialize for the Project后,lib目录下生成generated和i10n文件夹
文件说明:
-
generated包下的intl目录默认生成 messages_all.dart 和 messages_en.dart 文件,messages开头的文件无需手动修改,是自动生成的
-
generated包下的 I10n.dart 是Localizations和Delegate的实现,无需手动修改,是自动生成的
-
l10n包下存在一个intl_en.arb文件