Editing Android code in Android Studio with full IDE support

Opening the root directory of a Flutter project doesn’t expose all the Android
files to the IDE. Flutter apps contain a subdirectory named android. If you
open this subdirectory as its own separate project in Android Studio, the IDE
will be able to fully support editing and refactoring all Android files (like
Gradle scripts).

If you already have the entire project opened as a Flutter app in Android
Studio, there are two equivalent ways to open the Android files on their own
for editing in the IDE. Before trying this, make sure that you’re on the latest
version of Android Studio and the Flutter plugins.

In the “project view”, you should see a subdirectory immediately under
the root of your flutter app named android. Right click on it,
then select Flutter > Open Android module in Android Studio.