How to install flutter | Flutter tutorial

Flutter is the google’s mobile app SDK for develop the high-quality native app for iOS and android. We can develop the app by use of DART and javascript language support or we can run theses. Flutter’s hot reload helps you quickly and easily experiment, build UIs, add features, and fix bugs faster. Experience sub-second reload times, without losing state, on emulators, simulators, and hardware for iOS and Android.

Steps for setup the flutter

1. Download the flutter SDK or Cloning the flutter SDK

2. Add the flutter tools path globally

3. Run flutter doctor

4. Configure Editor for Flutter support

5. Setup the iOS/Android tools for development

6. Create the new Flutter Project

Step 1 : Download the flutter SDK or Cloning the flutter SDK

We can download the flutter alpha SDK version from Flutter official website or clone the SDK from Flutter Official Github Repository according to your OS.

  • Cloning the flutter SDK : – You can clone the alpha branch from flutter official Repository. 
    1
    Before clone the repository set the terminal path where you want to clone.

    Select the branch and copy the clone HTTPS linkClone Flutter RepositoryFlutter alpha branch


1
git clone https://github.com/flutter/flutter.git

                                                                                                        OR
We can directly clone the alpha branch (Branch Select according to you [dev, alpha, beta, hackathon])


1
2
git clone https://github.com/flutter/flutter.git -b alpha  
// git clone ($Repository URL) -b ($Branch name)

NOTE : – SDK’s are not available for master branch if you need the master branch you can directly clone them from GitHub (as specified by -b master), and then trigger a download of the SDK dependencies.


1
2
git clone -b master https://github.com/flutter/flutter.git
./flutter/bin/flutter --version

Step 2 : Add the flutter tools path globaly

You can set the PATH variable for the flutter according to you but we need to set the PATH variable globaly.
First find your flutter folder $PATH by use of 

1
pwd

 command and now run the below command.


1
2
export PATH=`pwd`/flutter/bin:$PATH
//export PATH=/Users/amangupta/Documents/flutter/bin:$PATH   (Example)





Step 3 : Run flutter doctor

Now you can run the flutter doctor command in terminal for check the dependencies you need to install to complete the setup.
This command checks your environment and displays a report to the terminal window. The Dart SDK is bundled with Flutter; it is not necessary to install Dart separately. Check the output carefully for other software you may need to install or further tasks to perform (shown in bold text).

Flutter Doctor terminal output

 

Step 4 : Configure Editor for Flutter support

Now we need to Download the flutter editor. Flutter is supported in different Editor but we use here Visual studio (Atom, Eclipse etc)
Download the visual studio.

Install the Flutter plugin

  • Invoke View -> Command Palette…
  • Type ‘install’, and select the ‘Extensions: Install Extension’ action
  • Enter flutter in the search field, select ‘Flutter’ in the list, and click Install
  • Select ‘OK’ to reload VS Code

Validate your setup with the Flutter Doctor

  • Invoke View -> Command Palette…
  • Type ‘doctor’, and select the ‘Flutter: Run Flutter Doctor’ action
  • Review the output in the ‘OUTPUT’ pane for any issuesAttach the flutter SDK by visual studio.
    Locate the Flutter SDK folder
    Attach the Flutter SDK with vistual studio

Step 5 : Setup the iOS/Android tools for development

To develop Flutter apps for iOS, you need a Mac with Xcode 9.0 or newer.
You can install the XCode from apple website.
and for Android app we need Android studio, ersion 3.0 or later.
Now run the below command in command prome


1
open -a Simulator
  • Install homebrew.
  • Open the terminal and run these commands to install the tools for deploying Flutter apps to iOS devices.

1
2
3
4
brew update
brew install --HEAD libimobiledevice
brew install ideviceinstaller ios-deploy cocoapods
pod setup

Step 6: Create the new Flutter Project

  • Invoke View -> Command Palette…
  • Type ‘flutter’, and select the ‘Flutter: New Project’ action
  • Enter a project name (e.g. myapp), and press Enter
  • Specify a location to place the project, and press the blue OK button
  • Wait for the project creation to continue, and the main.dart file to appear

Related Post

Introduction to Java Programming Language JAVA TUTORIALS Introduction to Java Programming Language What is JAVA Java is programming language that produces software for multiple platforms, w...
Variables Variables A variable is a named location in memory that is used to hold a value that can be modified by the program. All variable must be declared be...
Break Statement in JAVA Break Statement in JAVA The break statement is usually used in following two scenarios: The break statement terminates the loop immediately, and...
Java If-else Statement Java If-else Statement The Java if statement is used to test the condition. It checks boolean condition: true or false. For example, if a number i...
Compile C/C++ program (Dev-C/C++) what is Dev-C/C++? Dev-C/C++, developed by Bloodshed Software, is a fully featured graphical IDE(Integrated Development Environment),which ...
Switch Case Statement Switch Case Statement The switch statement is a multi-way branch statement. It provides an easy way to dispatch execution to different parts of c...

Leave a Reply

Your email address will not be published. Required fields are marked *