I. Command Input:

open ~/.bash_profile
Copy the code

Written inside

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

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

The export PATH = ~ / Documents/Flutter, Flutter/bin: $PATH (~ / Documents to folder, under the PATH to create Flutter folder)

Ii. Command Input:

open ~/.zshrc
Copy the code

I’ll say (global update bash_profile)

source ~/.bash_profile

CD to the folder of Flutter

git clone -b beta https://github.com/flutter/flutter.git
Copy the code

Iv. Command input after completion:

flutter doctor
Copy the code

Create a project

Default language Swift

flutter create flutterapp
Copy the code

Or use the OC language

flutter create -i objc  flutterappoc
Copy the code

Then go to Runner. Xcworkspace and double-click to open it.

/ = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = /

Attention ~ attention ~ attention ~ :

1. The clone flutter failure

Cloning into ‘flutter’…

remote: Enumerating objects: 18, done.

remote: Counting objects: 100% (18/18), done.

remote: Compressing objects: 100% (7/7), done.

error: RPC failed; curl 18 transfer closed with outstanding read data remaining

fatal: the remote end hung up unexpectedly

fatal: early EOF

fatal: index-pack failed

Error (cache overflow), type the following command:

git config --global http.postBuffer 524288000
Copy the code
git config --list
Copy the code
git config --global core.compression -1 
Copy the code
export GIT_TRACE_PACKET=1
Copy the code
export GIT_TRACE=1
Copy the code
export GIT_CURL_VERBOSE=1
Copy the code

Then continue the CD into the Flutter folder

git clone -b beta https://github.com/flutter/flutter.git
Copy the code

2. The following errors may occur if you download the installation package from the website of Flutter:

Error: The Flutter directory is not a clone of the GitHub project.

The flutter tool requires Git in order to operate properly; to set up Flutter, run the following command:

Git Clone -b beta github.com/flutter/flu…

Git clone -b beta github.com/flutter/flu…