How to install flutter for successful application development?

In this section, we are going to learn how to set up an environment for the successful development of the Flutter application.

System requirements for Windows

To install Flutter on the Windows system, you need first to meet these requirements for your development environment.

Operating SystemWindows 7 or Later (I am Windows 10. You can also use Mac or Linux OS.).
Disk Space400 MB (It does not include disk space for IDE/tools).
Tools1. Windows PowerShell
2. Git for Windows 2.x (Here, Use Git from Windows Command Prompt option).
SDKFlutter SDK for Windows
IDEAndroid Studio (Official)

Install Git

Step 1: To download Git, click here.

Step 2: Run the .exe file to complete the installation. During installation, make sure that you have selected the recommended option.

Flutter Installation

Get the Flutter SDK

  1. Download the following installation bundle to get the latest stable release of the Flutter SDK:flutter_windows_1.20.2-stable.zipFor other release channels, and older builds, see the SDK archive page.
  2. Extract the zip file and place the contained flutter in the desired installation location for the Flutter SDK (for example, C:\src\flutter).

 Warning: Do not install Flutter in a directory like C:\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:content_copy

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 flutter\bin using ; as a separator from existing values.
    • If the entry doesn’t exist, create a new user variable named Path with the full path to flutter\bin as its value.

You have to close and reopen any existing console windows for these changes to take effect.

 Note: As of Flutter’s 1.19.0 dev release, the Flutter SDK contains the dart command alongside the flutter command so that you can more easily run Dart command-line programs. Downloading the Flutter SDK also downloads the compatible version of Dart, but if you’ve downloaded the Dart SDK separately, make sure that the Flutter version of dart is first in your path, as the two versions might not be compatible. The following command (on macOS, linux, and chrome OS), tells you whether the flutter and dart commands originate from the same bin directory and are therefore compatible. (Some versions of Windows support a similar where command.)content_copy

  $ which flutter dart
  /path-to-flutter-sdk/bin/flutter
  /usr/local/bin/dart

As shown above, the two commands don’t come from the same bin directory. Update your path to use commands from /path-to-flutter-sdk/bin before commands from /usr/local/bin (in this case). After updating your shell for the change to take effect, running the which or where command again should show that the flutter and dart commands now come from the same directory.content_copy

  $ which flutter dart
  /path-to-flutter-sdk/bin/flutter
  /path-to-flutter-sdk/bin/dart

To learn more about the dart command, run dart -h from the command line, or see the dart tool page.

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:content_copy

C:\src\flutter>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:content_copy

[-] Android toolchain - develop for Android devices
    • Android SDK at D:\Android\sdk
    ✗ 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 is sent, and then no further information is 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.

System Requirements for macOS

To install Flutter on macOS system, you need first to meet these requirements for your development environment.

Operating SystemmacOS (64-bit)
Disk Space2.8 GB (It does not include disk space for IDE/tools).
Toolsbash
curl
git 2.x
mkdir
rm
unzip
which
IDEXcode (Official)

Get the Flutter SDK

1: Download the installation bundle of the Flutter Software Development Kit for macOS. To install Flutter SDK, Go to its official website.

2: When your download is complete, extract the zip file and place it in the desired installation folder or location.

3: To run the Flutter command, you need to update the system path to include the flutter bin directory.

  1. $ export PATH=”$PATH:`pwd`/flutter/bin”  

4: Next, enable the updated path in the current terminal window using the below command and then verify it also.

  1. source ~/.bashrc  
  2. source $HOME/.bash_profile  
  3. echo $PATH  

5: Now, run the $ flutter doctor command. This command checks for all the requirements of Flutter app development and displays a report of the status of your Flutter installation.

  1. $ flutter doctor  

6: When you run the above command, it will analyze the system and the details of all missing tools, which required to run Flutter as well as the development tools that are available but not connected with the device.

7: Install the latest Xcode tools if reported by the Flutter doctor tool.

8: Install the latest Android Studio and SDK, if reported by the Flutter doctor tool.

9: Next, you need to set up an iOS simulator or connect an iPhone device to the system for developing an iOS application.

10: Again, set up an android emulator or connect an android device to the system for developing an android application.

11: Now, install Flutter and Dart plugin for building Flutter application in Android Studio. These plugins provide a template to create a Flutter application, give an option to run and debug Flutter application in the Android Studio itself.

Want to work with web and mobile app development company?

A web and mobile development company is the best option if you’re planning a mid-sized or large project but don’t have your own team. To clarify, the biggest advantage of a software development company is that they can take ownership of the whole project, especially developing Vue app.

If you’re considering web development services, you can explore more about us – ArrowHiTech. Above all, we are proud to be one of the most well-established outsourcing companies all around the world. In addition, with over 14 years of experience, we can provide the best Flutter App development services for your business.

ArrowHiTech services

So, you can check us out now: ArrowHiTech services. Moreover, if you have any questions, don’t hesitate to contact us.

Tags

Share