Android Studio中Flutter项目红色高亮文件夹问题求助
Hey there! I get how frustrating those random red highlights can be, especially when everything else in your Flutter setup is working perfectly (great job getting flutter doctor to show no issues, by the way!). Let's fix this one step at a time, since you mentioned you don't need version control right now.
1. Turn Off VCS Integration (to fix the @style/NormalTheme red marker)
Since you're not using a version control system right now, the VCS indexing might be causing false error flags like the @style/NormalTheme issue. Here's how to disable it:
- Open File > Settings (or press
Ctrl+Alt+Son Windows/Linux,Cmd+,on Mac) - Navigate to Version Control in the left sidebar
- In the right pane, find your project in the list, click on it, and change the VCS dropdown menu to
<None> - Click Apply then OK to save the changes
This should immediately get rid of any VCS-related red markers.
2. Mark Auto-Generated Folders as "Excluded" (fix dart_tool & idea red highlights)
Folders like dart_tool and those inside idea are auto-generated by Flutter/Android Studio, and they shouldn't be indexed by the IDE. Marking them as excluded will stop the red highlighting:
- In the left Project view, right-click on the
dart_toolfolder - Hover over Mark Directory as and select Excluded
- Repeat this for all folders inside the
ideadirectory that are showing red highlights
Once marked as excluded, the IDE will ignore these folders, and the red color should disappear right away.
3. Optional: Clear IDE Cache (for stubborn cases)
If the above steps don't work immediately, a quick cache reset can fix lingering indexing issues:
- Go to File > Invalidate Caches...
- In the popup, select Invalidate and Restart
- Let Android Studio restart and reindex your project—this usually clears up any weird leftover highlight issues
That should cover all the red highlight problems you're facing! Everything should look clean and normal once you're done.
内容的提问来源于stack exchange,提问作者Prashant Rawat

