I have a Flutter project open in Android Studio Arctic Fox 2021.3.1 on a Mac.
Flutter is configured properly.
Somehow, I've have achieved the situation where a certain file, static_utils.dart, is not being treated as a dart file by Android Studio.
That is, it has the wrong icon next to it... which looks like a text file icon... and also the syntax checking is not working (that's the important part).
Already tried:
- File > Invalidate caches/restart
Interesting facts:
If I delete this file a re-create a new "dart file" of the same name, it still treats it as text(?)/not dart... but if I use a new name for the file, it works correctly.
Even files of the same problematic name in other projects are also losing their Dart association unless a new file is created with an unused name and the code is cut and pasted over.
So, it appears that there is dictionary somewhere in Android Studio that is establishing file association rules based on filename... and retaining the rules even when the file is deleted.
I can't find a way to fix this. I have tried this answer but it didn't work for me -- the file in question did not show up anywhere under any of the file types.
