Target Mobile, Web, & Desktop Apps via Flutter
Windows install
System requirements
To install and run Flutter, your development environment must meet these minimum requirements:
- Operating Systems: Windows 7 SP1 or later (64-bit)
- Disk Space: 400 MB (does not include disk space for IDE/tools).
- Tools: Flutter depends on these tools being available in your environment.
- Windows PowerShell 5.0 or newer (this is pre-installed with Windows 10)
Git for Windows 2.x, with the Use Git from the Windows Command Prompt option.
If Git for Windows is already installed, make sure you can run
git
commands from the command prompt or PowerShell.
Get the Flutter SDK
Download the following installation bundle to get the latest stable release of the Flutter SDK:
flutter_windows_v1.12.13+hotfix.8-stable.zip
For other release channels, and older builds, see the SDK archive page.
Extract the zip file and place the contained
flutter
in the desired installation location for the Flutter SDK (for example,C:srcflutter
; do not install Flutter in a directory likeC:Program Files
that requires elevated privileges).
If you don’t want to install a fixed version of the installation bundle, you can skip steps 1 and 2. Instead, get the source code from the Flutter repo on GitHub, and change branches or tags as needed. For example:
C:src>git clone https://github.com/flutter/flutter.git -b stable
You are now ready to run Flutter commands in the Flutter Console!
Update your path
If you wish to run Flutter commands in the regular Windows console, take these steps to add Flutter to the PATH
environment variable:
- From the Start search bar, enter ‘env’ and select Edit environment variables for your account.
- Under User variables check if there is an entry called Path:
- If the entry exists, append the full path to
flutterin
using;
as a separator from existing values. - If the entry doesn’t exist, create a new user variable named
Path
with the full path toflutterin
as its value.
- If the entry exists, append the full path to
Note that you have to close and reopen any existing console windows for these changes to take effect.
Run flutter doctor
From a console window that has the Flutter directory in the path (see above), run the following command to see if there are any platform dependencies you need to complete the setup:
C:srcflutter>flutter doctor
This command checks your environment and displays a report of the status of your Flutter installation. Check the output carefully for other software you might need to install or further tasks to perform (shown in bold text).
For example:
[-] Android toolchain - develop for Android devices • Android SDK at D:Androidsdk ✗ Android SDK is missing command line tools; download from https://goo.gl/XxQghQ • Try re-installing or updating your Android SDK, visit https://flutter.dev/setup/#android-setup for detailed instructions.
The following sections describe how to perform these tasks and finish the setup process. Once you have installed any missing dependencies, you can run the flutter doctor
command again to verify that you’ve set everything up correctly.
Warning: The flutter
tool uses Google Analytics to anonymously report feature usage statistics and basic crash reports. This data is used to help improve Flutter tools over time.
Flutter tool analytics are not sent on the very first run. To disable reporting, type flutter config --no-analytics
. To display the current setting, type flutter config
. If you opt out of analytics, an opt-out event will be sent, and then no further information will be sent by the Flutter tool.
By downloading the Flutter SDK, you agree to the Google Terms of Service. Note: The Google Privacy Policy describes how data is handled in this service.
Moreover, Flutter includes the Dart SDK, which may send usage metrics and crash reports to Google.
Android setup
Note: Flutter relies on a full installation of Android Studio to supply its Android platform dependencies. However, you can write your Flutter apps in a number of editors; a later step will discuss that.
Install Android Studio
- Download and install Android Studio.
- Start Android Studio, and go through the ‘Android Studio Setup Wizard’. This installs the latest Android SDK, Android SDK Platform-Tools, and Android SDK Build-Tools, which are required by Flutter when developing for Android.
Set up your Android device
To prepare to run and test your Flutter app on an Android device, you’ll need an Android device running Android 4.1 (API level 16) or higher.
- Enable Developer options and USB debugging on your device. Detailed instructions are available in the Android documentation.
- Windows-only: Install the Google USB Driver.
- Using a USB cable, plug your phone into your computer. If prompted on your device, authorize your computer to access your device.
- In the terminal, run the
flutter devices
command to verify that Flutter recognizes your connected Android device. By default, Flutter uses the version of the Android SDK where youradb
tool is based. If you want Flutter to use a different installation of the Android SDK, you must set theANDROID_HOME
environment variable to that installation directory.
Set up the Android emulator
To prepare to run and test your Flutter app on the Android emulator, follow these steps:
- Enable VM acceleration on your machine.
- Launch Android Studio > Tools > Android > AVD Manager and select Create Virtual Device. (The Android submenu is only present when inside an Android project.)
- Choose a device definition and select Next.
- Select one or more system images for the Android versions you want to emulate, and select Next. An x86 or x86_64 image is recommended.
- Under Emulated Performance, select Hardware - GLES 2.0 to enable hardware acceleration.
Verify the AVD configuration is correct, and select Finish.
For details on the above steps, see Managing AVDs.
- In Android Virtual Device Manager, click Run in the toolbar. The emulator starts up and displays the default canvas for your selected OS version and device.
Web setup
Warning: Note: As of 1.12, Flutter has early support for running web applications, but you need to be running the beta channel of Flutter at present. If you experience a problem that hasn’t yet been reported, please file an issue and make sure that “web” appears in the title.
To prepare to run and test your Flutter app on the web, you must install Chrome, if you haven’t already.
Set up an editor
You can build apps with Flutter using any text editor combined with our command-line tools. However, we recommend using one of our editor plugins for an even better experience. These plugins provide you with code completion, syntax highlighting, widget editing assists, run & debug support, and more.
Follow the steps below to add an editor plugin for Android Studio, IntelliJ, or VS Code. If you want to use a different editor, that’s OK, skip ahead to the next step: Test drive.
Install VS Code
VS Code is a light-weight editor with Flutter app execution and debug support.
- VS Code, latest stable version
Install the Flutter and Dart plugins
- Start VS Code.
- Invoke View > Command Palette….
- Type “install”, and select Extensions: Install Extensions.
- Type “flutter” in the extensions search field, select Flutter in the list, and click Install. This also installs the required Dart plugin.
Validate your setup with the Flutter Doctor
- Invoke View > Command Palette….
- Type “doctor”, and select the Flutter: Run Flutter Doctor.
- Review the output in the OUTPUT pane for any issues.
Test drive
This page describes how to create a new Flutter app from templates, run it, and experience “hot reload” after you make changes to the app.
Select your development tool of choice for writing, building, and running Flutter apps.
Create the app
Do you want to run your Flutter app on the web? The web version of Flutter is available on the beta channel. To try it out, check out the Write your first Flutter app for the web codelab.
- Invoke View > Command Palette.
- Type “flutter”, and select the Flutter: New Project.
- Enter a project name, such as
myapp
, and press Enter. - Create or select the parent directory for the new project folder.
- Wait for project creation to complete and the
main.dart
file to appear.
The above commands create a Flutter project directory called myapp
that contains a simple demo app that uses Material Components.
Note: When creating a new Flutter app, some Flutter IDE plugins ask for a company domain name in reverse order, something like com.example
. The company domain name and project name are used together as the package name for Android (the Bundle ID for iOS) when the app is released. If you think that the app might be released, it’s better to specify the package name now. The package name can’t be changed once the app is released, so make the name unique.
Tip: The code for your app is in lib/main.dart
. For a high-level description of what each code block does, see the comments at the top of that file.
Run the app
- Locate the VS Code status bar (the blue bar at the bottom of the window):
- Select a device from the Device Selector area. For details, see Quickly switching between Flutter devices.
- If no device is available and you want to use a device simulator, click No Devices and launch a simulator.
- To setup a real device, follow the device-specific instructions on the Install page for your OS.
- Press the Settings button—a cog icon gear on the top right (now marked with a red or orange indicator) next to the DEBUG text box that reads No Configuration. Select flutter. And choose the debug configuration: To create your emulator if it is closed or to run the emulator or device that is now connected.
- Invoke Debug > Start Debugging or press F5.
- Wait for the app to launch — progress is printed in the Debug Console view.
After the app build completes, you’ll see the starter app on your device.
Try hot reload
Flutter offers a fast development cycle with Stateful Hot Reload, the ability to reload the code of a live running app without restarting or losing app state. Make a change to app source, tell your IDE or command-line tool that you want to hot reload, and see the change in your simulator, emulator, or device.
- Open
lib/main.dart
. Change the string
´You have pushed the button this many times´
to
´You have clicked the button this many times´
Important: Do not stop your app. Let your app run.
- Save your changes: invoke Save All, or click Hot Reload .
You’ll see the updated string in the running app almost immediately.
Profile or release runs
Important: Do not test the performance of your app with debug and hot reload enabled.
So far you’ve been running your app in debug mode. Debug mode trades performance for useful developer features such as hot reload and step debugging. It’s not unexpected to see slow performance and janky animations in debug mode. Once you are ready to analyze performance or release your app, you’ll want to use Flutter’s “profile” or “release” build modes. For more details, see Flutter’s build modes.
Important: If you’re concerned about the package size of your app, see Measuring your app’s size.
System requirements
To install and run Flutter, your development environment must meet these minimum requirements:
- Operating Systems: Windows 7 SP1 or later (64-bit)
- Disk Space: 400 MB (does not include disk space for IDE/tools).
- Tools: Flutter depends on these tools being available in your environment.
- Windows PowerShell 5.0 or newer (this is pre-installed with Windows 10)
Git for Windows 2.x, with the Use Git from the Windows Command Prompt option.
If Git for Windows is already installed, make sure you can run
git
commands from the command prompt or PowerShell.
Get the Flutter SDK
Download the following installation bundle to get the latest stable release of the Flutter SDK:
flutter_windows_v1.12.13+hotfix.8-stable.zip
For other release channels, and older builds, see the SDK archive page.
Extract the zip file and place the contained
flutter
in the desired installation location for the Flutter SDK (for example,C:srcflutter
; do not install Flutter in a directory likeC:Program Files
that requires elevated privileges).
If you don’t want to install a fixed version of the installation bundle, you can skip steps 1 and 2. Instead, get the source code from the Flutter repo on GitHub, and change branches or tags as needed. For example:
C:src>git clone https://github.com/flutter/flutter.git -b stable
You are now ready to run Flutter commands in the Flutter Console!
Update your path
If you wish to run Flutter commands in the regular Windows console, take these steps to add Flutter to the PATH
environment variable:
- From the Start search bar, enter ‘env’ and select Edit environment variables for your account.
- Under User variables check if there is an entry called Path:
- If the entry exists, append the full path to
flutterin
using;
as a separator from existing values. - If the entry doesn’t exist, create a new user variable named
Path
with the full path toflutterin
as its value.
- If the entry exists, append the full path to
Note that you have to close and reopen any existing console windows for these changes to take effect.
Run flutter doctor
From a console window that has the Flutter directory in the path (see above), run the following command to see if there are any platform dependencies you need to complete the setup:
C:srcflutter>flutter doctor
This command checks your environment and displays a report of the status of your Flutter installation. Check the output carefully for other software you might need to install or further tasks to perform (shown in bold text).
For example:
[-] Android toolchain - develop for Android devices • Android SDK at D:Androidsdk ✗ Android SDK is missing command line tools; download from https://goo.gl/XxQghQ • Try re-installing or updating your Android SDK, visit https://flutter.dev/setup/#android-setup for detailed instructions.
The following sections describe how to perform these tasks and finish the setup process. Once you have installed any missing dependencies, you can run the flutter doctor
command again to verify that you’ve set everything up correctly.
Warning: The flutter
tool uses Google Analytics to anonymously report feature usage statistics and basic crash reports. This data is used to help improve Flutter tools over time.
Flutter tool analytics are not sent on the very first run. To disable reporting, type flutter config --no-analytics
. To display the current setting, type flutter config
. If you opt out of analytics, an opt-out event will be sent, and then no further information will be sent by the Flutter tool.
By downloading the Flutter SDK, you agree to the Google Terms of Service. Note: The Google Privacy Policy describes how data is handled in this service.
Moreover, Flutter includes the Dart SDK, which may send usage metrics and crash reports to Google.
Android setup
Note: Flutter relies on a full installation of Android Studio to supply its Android platform dependencies. However, you can write your Flutter apps in a number of editors; a later step will discuss that.
Install Android Studio
- Download and install Android Studio.
- Start Android Studio, and go through the ‘Android Studio Setup Wizard’. This installs the latest Android SDK, Android SDK Platform-Tools, and Android SDK Build-Tools, which are required by Flutter when developing for Android.
Set up your Android device
To prepare to run and test your Flutter app on an Android device, you’ll need an Android device running Android 4.1 (API level 16) or higher.
- Enable Developer options and USB debugging on your device. Detailed instructions are available in the Android documentation.
- Windows-only: Install the Google USB Driver.
- Using a USB cable, plug your phone into your computer. If prompted on your device, authorize your computer to access your device.
- In the terminal, run the
flutter devices
command to verify that Flutter recognizes your connected Android device. By default, Flutter uses the version of the Android SDK where youradb
tool is based. If you want Flutter to use a different installation of the Android SDK, you must set theANDROID_HOME
environment variable to that installation directory.
Set up the Android emulator
To prepare to run and test your Flutter app on the Android emulator, follow these steps:
- Enable VM acceleration on your machine.
- Launch Android Studio > Tools > Android > AVD Manager and select Create Virtual Device. (The Android submenu is only present when inside an Android project.)
- Choose a device definition and select Next.
- Select one or more system images for the Android versions you want to emulate, and select Next. An x86 or x86_64 image is recommended.
- Under Emulated Performance, select Hardware - GLES 2.0 to enable hardware acceleration.
Verify the AVD configuration is correct, and select Finish.
For details on the above steps, see Managing AVDs.
- In Android Virtual Device Manager, click Run in the toolbar. The emulator starts up and displays the default canvas for your selected OS version and device.
Web setup
Warning: Note: As of 1.12, Flutter has early support for running web applications, but you need to be running the beta channel of Flutter at present. If you experience a problem that hasn’t yet been reported, please file an issue and make sure that “web” appears in the title.
To prepare to run and test your Flutter app on the web, you must install Chrome, if you haven’t already.