问题:
一些 pub 包还不支持 null 安全性。
例如,intl_translation无法解析具有空安全运算符的文件,如果找到任何符号(如?、!等),则抛出如下错误。
Invalid argument(s): Parsing errors in lib/localizations/MainLocalizations.dart
#0 MessageExtraction._parseCompilationUnit (package:intl_translation/extract_messages.dart:117:7)
#1 MessageExtraction.parseContent (package:intl_translation/extract_messages.dart:102:14)
#2 MessageExtraction.parseFile (package:intl_translation/extract_messages.dart:87:12)
#3 main (file:///.../flutter/.pub-cache/hosted/pub.dartlang.org/intl_translation-0.17.10+1/bin/extract_to_arb.dart:98:31)
#4 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:281:32)
#5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
然后它生成的 dart 文件也没有使用 null 安全性,并且在$ flutter run
.
那么有没有办法为至少成功编译禁用警告或空安全?因为
$ flutter run --no-sound-null-safety
没有帮助:(
感谢您的任何帮助!