Flutter, developed by Google, is a powerful open-source framework for building cross-platform mobile applications. With its fast development cycles, expressive UI, and native performance, Flutter has gained popularity among developers.
In this blog post, we will guide you through the step-by-step process of setting up Flutter on your machine.
To get started with Flutter, you need to install the Flutter SDK. Follow these steps:
Download the Flutter SDK for your operating system (Windows, macOS, or Linux).
Extract the downloaded archive to a directory of your choice. For example, on Windows, you can extract it to "C:\flutter" or any specific folder which you like.
Add the Flutter SDK to your system's PATH variable:
Open the Start menu and search for "Environment Variables."
Select "Edit the system environment variables."
Click on the "Environment Variables" button.
In the "System Variables" section, select "Path" and click "Edit."
Add the Flutter SDK's "bin" directory path to the list. For example, "C:\flutter\bin" or any specific folder in which you have you have extracted the Flutter downloaded archive. For example, "path-to-folder\flutter\bin".
Click "OK" to save the changes.
Open a terminal window.
Run the command
sudo nano /etc/paths.
Add the path to the Flutter SDK's "bin" directory at the end of the file.
Press Ctrl + X, then Y, and Enter to save the file.
Once everything is done, you can check and verify your Flutter install and check where it has been installed using the below command,
Great, as of now Flutter installation has been done and verified. Now, run the below command to see if there are any platform dependencies you need to complete the setup,
If any dependencies are pending it will be highlighted as a bold text, take required fixes for the same and run the same command again to see if there are any remaining things required.
Install Android Studio
Go through the
Android Studio Setup Wizardand complete Android Studio setup in your environment.
flutter doctorto confirm that Flutter has located your installation of Android Studio. If Flutter cannot locate it, run
flutter config --android-studio-dir=<directory>to set the directory that Android Studio is installed to.
Good, our IDE (Android Studio) and Flutter are both installed in our environment/system.
Agree to Android Licenses
Now, before using Flutter, You must need to agree to the licenses of the Android SDK platform.
To do that, perform the below steps,
Open terminal/cmd and execute below mentioned command,
Review the terms carefully and once done agree to them.
Once agreed to licences, re-run
flutter doctorcommand again to confirm that you are ready to use Flutter.
Congratulations! You have successfully set up Flutter on your machine. You are now ready to start building high-quality, cross-platform mobile applications using Flutter.
Happy coding and thank you for reading, I hope you found this article useful.