website

  • Flutter website
  • Flutter Chinese Community
  • Because Chinese website

Configuring domestic Mirroring

  • Configuration commands

    export PUB_HOSTED_URL=pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=storage.flutter-io.cn

Download and install Flutter

  • Download the Flutter SDK and unpack the configuration.

  • Obtain it through Git (recommended) :

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

  • Problem encountered: SSL_ERROR_SYSCALL in connection to github.com:443

Generally for the network problem or agent problem

fatal: unable to access 'https://github.com/flutter/flutter.git/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
Copy the code
  • Solution: Divided into HTTP and HTTPS

    git config –global –unset http.proxy git config –global –unset https.proxy

Restart the terminal after setting up!

Add Flutter to the global environment variable

  • Open (or create).bash_profileI’m inThis user nameCreate a folder

Open (or create) $HOME/.bash_profile. File paths and file names may differ on your machine.

Bash_profile check whether there is a. Bash_profile file, such as touch.bash_profile

Add the following configuration

Export PUB_HOSTED_URL=https://pub.flutter-io.cn // Domestic users need to set export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn // Set export PATH=PATH_TO_FLUTTER_GIT_DIRECTORY/flutter/bin:$PATH for domestic usersCopy the code
  • Note: PATH_TO_FLUTTER_GIT_DIRECTORY is the path of your flutter, such as “~/document/code”.

    Export PATH=/Users/ user name folder /flutter/bin:$PATH

  • Then, verify whether the configured flutter is available with which flutter:

    which flutter

The current development environment of flutter was verified by THE FLUTTER Doctor

flutter doctor
Copy the code
  • Problem encountered: Failed to retrieve the Dart SDK

    Downloading Dart SDK from Flutter engine 241c87ad800beeab545ab867354d4683d5bfb6ce… % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 –:–:– 0:03:02 –:–:– 0 curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to storage.googleapis.com:443

    Failed to retrieve the Dart SDK from: storage.googleapis.com/flutter_inf… If you’re located in China, please see this page: Flutter/dev/community/c…

Solution: switch the server node under the VPN, it is good. Guess is the network is bad!

Re-run after normal: as shown

The environment is set up, but Android Studio needs to be installed and configured.