Creating a Flutter Project in Android Studio

This article covers creating and running an Android Studio Flutter app.

Android Studio enables developers to create new Flutter projects using an easy-to-use wizard. Let’s get started!

Using the New Project Wizard

First, click on New Flutter Project from the welcome screen or click on New and then New Flutter Project from the File menu. Android Studio will open the New Project dialog.

New Project Start Wizard

Android Studio then prompts you for the path to your Flutter SDK directory. Verify the path is correct and then hit the Next button.

Flutter SDK Directory

The next step is to enter your project name. In the New Project box, enter the project name. No other changes are required. Click on Create.

Entering the Project Name

Android Studio creates the project and prompts the user to open it.

Project Open in IDE

Flutter Code

We write Flutter code in the Dart programming language. All Dart files end with the file name .dart. Our generated Flutter app has a file called main.dart in a folder called lib. We can open this file by clicking on it.

Android Studio Side Nav Example

Every Flutter app starts with a main() function. We can find it in the main.dart file.

Running our App in the Chrome Browser

Our first step in running the app is to select the Chrome (web) browser as the target. We will use this selection box when we choose other targets such as iOS Simulator or Android Emulator.

Selecting Flutter App to run in Chrome

Next, we can start running the project by hitting the play button.

Starting the App in Android Studio

A new browser window will appear running our app! Give it a try!

First Flutter App Running

We just ran our first Flutter App!

You can hit the stop button in Android Studio to stop the app from running.

Stopping Button in Android Studio

Review

Congratulations! We used the Android Studio wizard to create and run our first app! Let’s review some of what we learned:

  • Android Studio includes a wizard allowing us to create a new Flutter project.

  • Once we create the project, a code editor opens, allowing us to see all the files and created code.

  • We can then run our Flutter app in the Chrome web browser with Android Studio.

  • We can use the stop button to finish running our app.

Author

Codecademy Team

'The Codecademy Team, composed of experienced educators and tech experts, is dedicated to making tech skills accessible to all. We empower learners worldwide with expert-reviewed content that develops and enhances the technical skills needed to advance and succeed in their careers.'

Meet the full team