A simple introduction

Install VScode and install Flutter. 2. Install Xcode and Android Studio to ensure normal operation; 3, configuration from scratch, teaching hand in hand, if you have any questions, please leave a message;

Install VSCode

1. Installation address

Click on the download: https://code.visualstudio.com/Download

2. If there is no ladder, wait patiently

3. Download completed

Download complete, under the download folder.

4. Double-click the downloaded installation package

At this time may encounter the computer firewall, in Settings – Privacy to open, or some computers can directly click open.

5. First open

The first time I open it, I get a reminder here, click Settings below.

6. Move to the program

Open the download folder and drag VSCode into the application.

7. Installation completed

At this point, VSCode is installed. For the first time, the panel is in front of you. The next step is to install the relevant frameworks and SDKS.

Install FlutterSDK

1. Download FlutterSDK

Click on the download https://flutter.dev/docs/development/tools/sdk/releases?tab=macos#macos

2. Move the SDK to the specified folder

3. Open the terminal

open .bash_profile
Copy the code

4. Save the configuration path to the file

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=/Users/demo/flutter/bin:$PATH
Copy the code

5, save

open ~/.zshrc 
Copy the code

6. Save the Settings and execute them

source ~/.zshrc
Copy the code

At this point I rebooted my computer

There is a pit here. I did not restart the computer when I installed it for the first time, so no matter how I debug it later, it will be wrong. Restart the terminal and run the following command:

flutter -h
Copy the code

At this time, there will be a firewall, click cancel, open the firewall, and execute again.

Vscode configuration

1. Open VScode-Extensions

2. Check the Flutter and install

3. Check and install the Dart

4, Click the View-Command Palette…

Shortcut keys Command + Shift + P select

run flutter doctor
Copy the code

The purpose is to check the flutter installationAt this point, according to the prompts, there are two problems:

[!] Flutter (Channel stable, 2.0.5, on Mac OS X 10.15.5 19F101 Darwin-x64, • Flutter version 2.0.5 at /Users/demo/ Framework revision ADC687823A (13 days ago), • Engine Revision B09F014E96 • Dart Version 2.12.3 • Pub Download Mirror https://pub.flutter-io.cn • Download mirror https://storage.flutter-io.cn onto university Downloaded executables cannot execute on host. See https://github.com/flutter/flutter/issues/6207 for more information [!] Develop for Android Devices (Android SDK Version 28.0.0) • Android SDK at / / Users/demo/Library/Android SDK ✗ Flutter the requires 29 and the Android SDK Android BuildTools 28.0.3 To update the Android SDK visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions. ! Some Android licenses not accepted. To resolve this, run: Flutter doctor -- Android -licenses [✓] Xcode - develop for iOS and macOS • Xcode at / Applications/Xcode. App/Contents/Developer, Xcode 12.4, Chrome - develop for the web • Chrome at /Applications/Google • CocoaPods version 1.10.0 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome. The app/Contents/MacOS/Chrome / ✓ Android Studio (version 3.6), the Android Studio at/Applications/Android App /Contents • Flutter plugin version 45.1.1 • Dart Plugin version 192.8052 • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211) [✓] VS Code (version 1.55.2) • VS Code at /Applications/Visual App /Contents • Flutter Extension version 3.21.0 [✓] Connected device (1 available) • Chrome (Web) • Chrome • Web-javascript • Google Chrome 90.0.4430.93! Doctor found issues in 2 categories. exit code 0Copy the code

① Execute as prompted

flutter doctor --android-licenses
Copy the code

The user must enter y for confirmation. After execution, do not rush to solve the second problem. Repeat the Run Flutter Doctor step. I have one problem left.

Update the AndroidSDK

test

Create a Flutter project by clicking the command+ Shift + P shortcut on the View-Command Palette2. Note that the project name should be lowercase3. Select the emulator we want to run

4. As shown in the figure, enter Flutter Run to testFirst implementation is a long process, 2000 years later… 5, Mm ~ trial run successful. Installation complete. Welcome to delai League!6. If you are interested, you can choose iOS simulator and run it to see the results.