Step 1 Download the Flutter SDK
Dev /docs/develo…
No need to climb the wall: github.com/flutter/flu…
Step 2 Decompress the SDK and put it in the repository directory
Open the terminal and enter: open ~/Library
Copy the decompressed FOLDER folders into this folder
Step 3 add the bin path to the environment variable
Use VScode to open the ~/.bash_profile file
(how to open a file using vscode)
- Open the vscode
shift + command + P
Open command Panel- Select the following commands
After the installation is successful, open the terminal and enter code ~/.bash_profile
Step 4 Add the following configuration to ~/.bash_profile
export PATH=~/Library/flutter/bin:$PATH
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
Copy the code
Step 5 Save the file to update the current configuration
Run the source ~/.bash_profile command
Step 6 Verify that the flutter/bin directory is in PATH
Run the echo $PATH command
A path similar to /Library/flutter/bin: will be displayed if the flutter is installed successfully
Step 7 Install development tools
Android Studio: developer.android.com/studio/?hl=…
Xcode: Search the App Store for the latest version of Xcode to download and install
Step 8 Configure the development tool
Android Studio
- Open the configuration
- Select Plugins to install the Flutter plugin (and automatically install the Dart plugin)
- Install an emulator
- Vscode Click F5 to select the installed terminal
Xcode
- Install CocoaPods to open the terminal:
sudo gem install cocoapods
CocoaPods is a tool for iOS projects to manage third-party library dependencies. Through CocoaPods, we can manage each third-party library version more easily without having to do too much configuration. Intuitive, centralized and automated management of third-party libraries for our projects.
- perform
flutter doctor
Check the status and follow the instructions
- Activate an emulator
Step 9 Start the FLUTTER project
- Open Vscode F5 and select the device you want to execute on (iPhone for example)
- Open the Flutter project terminal that you want to run
- Check emulator execute command:
flutter devices
The diagram below:
- Start project execution command:
flutter run
- Wait for the simulator to start the project successfully