简体   繁体   English

android 工作室中的 Main.dart 无法识别为 as.dart 文件

[英]Main.dart is not recognising as as .dart file in android studio

In flutter project, main.dart is not recognizing as.dart file in android studio as shown in the screenshot attached.在 flutter 项目中,main.dart 无法识别为 ZC31B32364CE19CA8FCD150A417ECCE5 工作室中 ZC31B32364CE19CA8FCD150A417ECCE5 中的文件。 If I change the name of the file then it's recognizing.如果我更改文件的名称,那么它正在识别。 click here to view screenshot点击这里查看截图

Looks to me that the IDE is incorrectly associating your file as a Text file.在我看来,IDE 错误地将您的文件关联为文本文件。

  1. Go to File -> Settings (Ctrl + Alt + S) Go 到文件 -> 设置(Ctrl + Alt + S)
  2. Search for "File Types"搜索“文件类型”
  3. Look for Text in the list在列表中查找文本
  4. Check if there is no entry for "main.dart" in the Text Type association.检查文本类型关联中是否没有“main.dart”条目。
  5. If so, remove it.如果是这样,请将其删除。

I managed to make it work was by doing the following (on Android Studio for MacOS):我设法使它工作是通过执行以下操作(在 Android Studio for MacOS 上):

  • on the main.dart file, right click and click on Override File Type在 main.dart 文件上,右键单击并单击Override File Type
  • in the list that appears, select: Dart在出现的列表中,select: Dart

I am facing the same problem, fixed it by right click the file and select the Override File Type menu, in the popup file type menu, select the dart or whatever the really file type you needed.我面临同样的问题,通过右键单击文件和 select Override File Type菜单,在弹出的文件类型菜单中,select dart 或您真正需要的文件类型修复它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM