This is the first day of my participation in the Gwen Challenge in November. Check out the details: the last Gwen Challenge in 2021.

Read the official recommended environment configuration document of Flutter Chinese

Next, I will follow the official process with pictures and texts, and make supplements to the unclear official explanations.

Download the Flutter SDK

Download the official download address of Flutter SDK

Tip: Try to download the latest stable version.

Now download down is the folder, do not need to decompress, so the official document decompression part can be ignored.

Configure the operating environment

2.1

Premise: Copy the folder you just downloaded to your desired location, remember this address, you will use later.

2.2

Run the following command on any terminal:

ls -a

Check whether the.bash_profile file exists. If not, run the following command:

touch .bash_profile

Generate the.bash_profile file. Run ls -a to check whether the file is successfully created. When you see the red icon below, proceed to the next step

2.3

Run the following command to open the. Bash_profile file

open .bash_profile

Copy the code into the.bash_profile file

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
Copy the code

Attention!! Export PATH = / Users/admin/flu/flutter/bin: $PATH that corresponds to your ideal location paths, explained as follows

Export PATH = < position of the downloaded flutter >/flutter/bin:$PATH

If you don’t know the location, please open terminal and drag the folder into terminal to see the location, as shown in the picture below. The address 1 points to is the address in <> above.

2.4

Run the following command to refresh the current terminal window. When this command is executed, no terminal changes are seen, as long as no errors are reported.

source ~/.bash_profile

Execute the command

flutter -h

If the following figure is displayed, the environment configuration is successful.

2.5

Run the following command to see if any other dependencies need to be installed to complete the installation. This is also the last step to check that the FLUTTER environment is fully configured.

flutter doctor

When the author executes this command, the terminal is shown as follows

Read the X carefully. Now let’s solve this problem (assuming you have Android Studio installed on your MAC).

Open Android Studio preferences. Shortcut keys (open Android Studio, then Command+,) as shown below.

After Android Studio execution is complete, the terminal executes the Flutter Doctor again and looks at the terminal again.

Perform the operation as prompted, and select Y

flutter doctor –android-licenses

Finally, the Flutter Doctor is executed as shown below

When we see something like the image above, the Flutter environment under MAC has been configured successfully.