Flutter Installation
In this blog, we will learn to successfully set up an environment for the successful development of the Flutter application, first for Windows and then for MacOS.
Flutter Installation for Windows -:
Make sure your system satisfies all the requirements mentioned below.
System Requirements -
Operating System: Windows 7 SP1 or Later
Disk Space: 1.64 GB (Not including disk space required for IDE/tools)
Tools: 1. Windows PowerShell 5.0
(Check if you are able to successfully run git commands from the command prompt or PowerShell.).
SDK Flutter SDK for Windows
IDE Android Studio (Official)
- Get the Flutter SDK
- Download the latest available installation bundle of the Flutter SDK for windows.
- Once the download is complete, extract the zip file and place it in the desired installation folder or location, for example, "C:\src\flutter"
( Warning: Don’t place the Flutter SDK where the administrator's/elevated permission is required.)
- Update your path
- To update the path variable, type ‘env’ in the search bar and select — ‘Edit the system environment variables for your account.’
- Now click on New and paste the following — “C:\src\flutter\bin”
- Now, run the flutter doctor command in the command prompt. This command checks for a report of the status of your Flutter installation and displays a comprehensive message.
( Carefully check the output for other software that you might need to install or other tasks to perform)
- Install Android Studio
- Download the Android Studio .exe file or .zip file.
- Once downloaded, Install the Android Studio by following the steps of the installation wizard.
- Set up the Android device
- Enable Developer Options & USB Debugging on your Android Device. (You can follow instructions from the Android documentation.)
- Install the Google USB Driver.
- Plug in your phone into your computer using a USB Cable. If prompted on your device, allow your computer to access your device.
- Check if Flutter recognizes your connected Android device by running the flutter devices command.
- Set up the Android Emulator
- Go to Android Virtual Device(AVD) Manager.
- Click on Create Virtual Device.
- Choose Device Configurations and click next.
- Select the system image for your selected Android Version.
- Verify the AVD configuration setup is correct and click Finish.
- Now, In AVD Manager, click Run in the toolbar.
- The emulator starts up, displaying the canvas according to your selected OS version and device.
- Install Flutter and Dart plugin in Android Studio.
- Agree to Android Licenses
- Install Java 8 and set “JAVA_HOME” environment variable to the JDK’s folder.
- Run “flutter doctor --android-licenses” in command prompt with administrator permissions.
- For Windows desktop development
- If you have Flutter 2.9 beta and newer, install Visual Studio 2022, or if you have Flutter 2.8.1, install Visual Studio 2019.
- To enable Win32 desktop support, execute “flutter config --enable-windows-desktop” command.
Flutter Installation for macOS-:
Make sure your system satisfies all the requirements mentioned below.
System Requirements -
Operating System: macOS
Disk Space: 2.8 GB (Not including disk space required for IDE/tools)
Tools: Xcode
SDK Flutter SDK for macOS
IDE Xcode (Official)
- Download the latest Flutter Installation Bundle
- Once downloaded, extract the zipped file to your desired location.
- Update the system path to include the flutter bin directory by executing the following command export PATH="$PATH:`pwd`/flutter/bin”
- You can permanently set the path by following these steps.
- Run the flutter doctor command to see if there are any dependencies you need in order to install to complete the setup.
- After Installing the missing dependencies by following steps given in the report by the above command, run the flutter doctor command again to confirm.
- Install the latest Xcode and Android Studio tools if reported by the Flutter doctor tool.
- Setup the iOS Simulator
- On your Mac, find the Simulator by executing open -a Simulator command.
- Ensure your simulator is using a 64-bit device.
- For Android setup
- Download and install the Android Studio Tools.
- Run flutter doctor and make changes as asked in the report.
- Setup your Android Device or Android Emulator by following the same steps as we discussed for Windows.
- For macOS desktop development
- Enable desktop support by flutter config --enable-macos-desktop command.
Once, you’re done with all these steps you’re all set to work and create apps with Flutter.