首页 文章

如何从Android Studio中为Flutter项目分析文件?

提问于
浏览
3

我正在为我的Flutter程序使用Android Studio,我想要包含一个像Flutter Gallery app那样的dart文件,这样我就不会将它作为我程序的一部分 . 我怎样才能做到这一点?解决方法是使用文件扩展名,如'txt'而不是'dart',但这不是很好 .

我尝试通过右键单击文件将文件标记为纯文本,这没有用 . 我可以承担错误警告,但如果无法编译该文件,Android Studio不允许我重新加载程序(如下所示) .

enter image description here

1 回答

  • 2

    analysis_options.yaml 有一个选项

    analyzer:
      exclude:
        - "path/to/the/file/to/exclude.dart"
        - "or/pattern/**/*.dart
    

    但它还没有完全发挥作用 .

    有关详细信息,请参阅https://github.com/dart-lang/sdk/issues/34053 .

相关问题