Intro to Flutter & installation
What is Flutter?
There are many ways to build native app for ios and anroid. You can use swift or Objective-C for building ios app and Java for android. But the problem is... We need to learn all of programming languages to build those apps for that platform.
Google made flutter which is open-source development framework built with Dart language to build native app for ios and android in single code base.
First of all visit here Flutter Dev Site
In this tutorial guide, i will use Mac OS as sample. Download Flutter SDK and open terminal
- This is command that you can make folder which is name of "developement" in home directory
- This is command that you cam make file ".bash_profile"
- You will see that text editor is opened
- Type like below inside of .bash_profile
save it and close it. This is file path setup for computer to understand where flutter SDK is
$ cd development
Now let's move into "developement" folder we already made. This is command that you move into "developement" folder.
Move Flutter SDK from "download" folder into "developement" folder
Run this code in the same folder(which is'development') of Flutter SDK. Type this in terminal
- Checkout whether flutter command is working
Install Xcode 9.0 or newer from via Apple Developer Site or Mac App Store
Open Xcode and select agreement on it and check open ios simulator whether it is fully worked.
open -a Simulator
- Connect to ios device
- Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
and then type command like below
brew install --HEAD usbmuxd brew link usbmuxd brew install --HEAD libimobiledevice brew install ideviceinstaller ios-deploy cocoapods pod setup
Type command like below in the flutter project directory and click "Runner" on left panel of Xcode. To deploy app into device, you will need to signin(Add account) with apple ID as developer.
$ open ios/Runner.xcworkspace
- Connect ios device with mac and type code like below
$ flutter run
Install android studio from android studio website
Open android studio and follow setup wizard.
- Android SDK
- Android SDK Platform-Tools
- Android SDK Build-Tools
- Install android emulators
- Open android studio
- Select Tools on the top menu
- Select AVD Manager
You will sed this AVD manager screen and click "Create Virtual Device"
Select Android image version
More detailed info about AVD manager installation. Please click android AVD manager Installation
$ flutter emulators
You will see message like below image. You will see 2 emulators. One is from ios and the other is from android.
To launch emulator what you want to test with, type like below code
$ flutter emulators --launch pixel
Test with android devices
To test with device, it should be Android 4.1 (API level 16) or higher.
- Enable USB Debugging on Developer Option
- Connect device via USB and authorize it
- type "flutter devices" on the terminal
$ flutter devices
Check status of installation dependencies
You will see which dependencies need to be installed.
$ flutter doctor
Setup an editor
In this guide, i will use VScode as sample.
- Open Vs code editor
- Click View > Command Palette on the top menu
- Type install and select "Extensions: Install Extensions"
- Type "flutter" and click for installation