To start, you need to install Android Studio version 3.0 or later, which offers an integrated IDE experience for Flutter. Refer to the official Android Studio website for detailed instructions.
Install the Flutter and Dart Plugins
After successfully installing Android Studio, follow these steps to install the Flutter and Dart plugins:
- Start Android Studio.
- Open plugin preferences (Configure > Plugins as of v3.6.3.0 or later).
- Select the Flutter plugin and click Install.
- Click Yes when prompted to install the Dart plugin.
- Click Restart when prompted.
Open Plugin Preferences:
- For macOS: Preferences > Plugins
- For Linux and Windows: File > Settings > Plugins
Now, select Marketplace, choose the Flutter plugin, and click Install.
Creating the Application
After installing the Dart and Flutter plugins, create a Flutter app to verify everything is working correctly:
- Open the IDE: Select Start a new Flutter project.
- Choose the Project Type: Select Flutter Application and click Next.
- Verify the Flutter SDK Path: Ensure the SDKโs location is specified (select Install SDKโฆ if the text field is blank).
- Enter Project Details: Provide a project name (e.g., myapp) and click Next.
- Finish Setup: Click Finish and wait for the IDE to create the project.
Note: When creating a new Flutter app, some Flutter IDE plugins might ask for a company domain name in reverse order, like com.example. This domain name, combined with the project name, forms the package name for Android and the Bundle ID for iOS. Itโs essential to choose a unique package name, as it cannot be changed once the app is released.
Running the Application
To run the newly created Flutter application, follow these steps:
- Locate the Main Toolbar: In Android Studio, find the main toolbar.
- Select a Device: In the target selector, choose an Android device for running the app. If none are available, select Tools > Android > AVD Manager to create one. For details, refer to Managing AVDs.
- Run the App: Click the run icon in the toolbar or use the menu item Run > Run.
After the app build completes, youโll see the starter app on your device.
By following these steps, you can set up Android Studio to run Flutter applications smoothly and efficiently.