Here is an answer to your question by Flutter: Get Started: Configure Editor
You can either use Android Studio or Visual Studio Code as a Flutter (main.dart) project editor.
Steps are also mentioned in this document, how you can open Flutter project with these editors:
Visual Studio Code (VS Code) setup
VS Code: A light-weight editor with Flutter run and debug support.
Install VS Code: VS Code, version 1.20.1 or later.
Install the Dart Code plugin
- Start VS Code
 
- Invoke View>Command Palette…
 
- Type ‘install’, and select the ‘Extensions: Install Extension’ action
 
- Enter dart code in the search field, select ‘Dart Code’ in the list, and click Install
 
- Select ‘OK’ to reload VS Code
 
Validate your setup with the Flutter Doctor
- Invoke View>Command Palette…
 
- Type ‘doctor’, and select the ‘Flutter: Run Flutter Doctor’ action
 
- Review the output in the ‘OUTPUT’ pane for any issues
 
Android Studio setup
Android Studio: A complete, integrated IDE experience for Flutter.
Install Android Studio: Android Studio, version 3.0 or later.
Install the Flutter and Dart plugins
- The Flutter plugin powers Flutter developer workflows (running, debugging, hot reload, etc.).
 
- The Dart plugin offers code analysis (code validation as you type, code completions, etc.).
 
To install these:
- Start Android Studio.
 
- Open plugin preferences (Preferences>Plugins on macOS,  File>Settings>Plugins on Windows & Linux).
 
- Select Browse repositories…, select the Flutter plug-in and click install.
 
- Click Yes when prompted to install the Dart plugin.
 
- Click Restart when prompted.