Install the Flutter SDK

Click to enterFlutter Chinese Website.

Two, unzip to the directory you want

My path is: /Users/ MacbookPro

3. Configure environment variables

Open the terminal and configure environment variables

vi ~/.bash_profile
Copy the code

Write fluuter mirror configuration and Fluuter path configuration

#Flutter mirror configuration

export PUB_HOSTED_URL=https://pub.flutter-io.cn

export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

#Environment Configuration of Flutter

#This path uses your own location
export FLUTTER=/Users/macbookpro/flutter/bin

export PATH=$FLUTTER:$PATH

Copy the code

After the configuration is complete, enter a command on the terminal to load the configuration

source ~/.bash_profile
Copy the code

Check whether Fluuter is properly configured and enter the fluuter on the terminal

flutter doctor
Copy the code

If the message commond not found proves that there is a problem with your path, check again yourself.

Solve problems

Android Toolchain – Develop for Android Devices (Android SDK version 28.0.3) Some Android licenses are not accepted. To resolve this, run: Flutter doctor — Android-licenses

flutter doctor --android-licenses
Copy the code

【2】, Xcode – Develop for iOS and macOS university Xcode installation is incomplete; A full installation is necessary for iOSdevelopment. Download at: developer.apple.com/xcode/downl… install Xcode via the App Store.Once installed, run: Sudo xcode – select – switch/Applications/xcode. The app/Contents/Developer this machine has been installed xcode, it is need to execute the following command

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo gem install cocoapods
Copy the code

Those who qualify can qualify onto university. 【3】, Android Studio (version 3.4) Qualify Flutter plugin not installed; Those who qualify can go onto university. Those who qualify can go onto university. this adds Dart specific functionality. Android Studio has been installed on the machine, but these two plug-ins are missing, so we need to install them. Open Android Studio -> Configure ->Plugins to search for flutter and install

Check again after solving the problem

fltter doctor
Copy the code

At this point, the environment configuration is successful!

Configure Dart environment variables

Because the Flutter is integrated with Dart, we do not need to install it from the Dart website. But if you want to simply learn the Dart syntax, do the following to configure environment variables.

vi ~/.bash_profile
Copy the code
#Dart environment variables

#This is the dart SDK path all the way down to the bin directory and that's my full path
export DART_HOME=/Users/macbookpro/flutter/bin/cache/dart-sdk/bin

export PATH="${DART_HOME}:${PATH}"
Copy the code
source ~/.bash_profile
Copy the code
dart
Copy the code

The successful running