Flutter 環(huán)境搭建
1.操作系統(tǒng)
- macOS
2.安裝Homebrew
-
終端執(zhí)行以下命令
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
3.安裝Flutter SDK
- Flutter SDK地址:https://flutter.dev/docs/development/tools/sdk/releases?tab=macos
- 配置flutter 的環(huán)境變量 和鏡像
# Android Configuration export ANDROID_HOME=/Users/qxw7463/Library/Android/sdk PATH=$PATH:$ANDROID_HOME/build-tools PATH=$PATH:$ANDROID_HOME/platform-tools PATH=$PATH:$ANDROID_HOME/tools PATH=$PATH:$ANDROID_HOME/tools/bin/ # Flutter export FLUTTER_HOME=/Users/qxw7463/flutter PATH=$PATH:$FLUTTER_HOME/bin:$PATH # Flutter mirror pub export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn # Dart (as part of Flutter) export DART_HOME=/Users/qxw7463/flutter/bin/cache/dart-sdk PATH=$PATH:$DART_HOME/bin:$PATH PATH=$PATH:/Users/qxw7463/.pub-cache/bin:$PATH
4.配置iOS 環(huán)境
- Appstore 下載 Xcode 11.2
- Mac self service -> Develop -> Xcode 11.2
- 下載鏈接: https://download.developer.apple.com/Developer_Tools/Xcode_11.2.1/Xcode_11.2.1.xip
5.配置Android 環(huán)境
- 下載安裝
官網(wǎng)地址: https://developer.android.google.cn/studio - 命令行安裝
- step1 安裝 Java8
- step2 brew cask install android-studio
- step3 brew cask install android-sdk
6.VS code 安裝
- 下載安裝
官網(wǎng)地址:https://code.visualstudio.com/ - 命令行
brew cask install visual-studio
7.執(zhí)行 flutter doctor 檢測安裝是否完成
? mobile-docs git:(onboarding) ? flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[?] Flutter (Channel stable, v1.9.6, on Mac OS X 10.13.6 17G65, locale en-US)
[?] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[?] iOS toolchain - develop for iOS devices
[?] Android Studio (version 3.3)
[?] VS Code (version 1.30.2)
[!] Connected device
8.開發(fā)工具的選擇
在學(xué)習(xí)Dart語言的時(shí)候、可選擇 VSCode 比較輕量級(jí)
在學(xué)習(xí)flutter過程中秃诵、可選擇Android Studio续搀、因?yàn)楦鞣N集成使用起來比較方便,尤其是做插件開發(fā)
VS code 插件
- Awesome Flutter Snippets
- bloc
- Bloc Code Generator
- Bracket Pair Colorizer
- vscode-icons
- Rainbow Brackets
- Dart
- Flutter
- Chinese (Simplified) Language Pack for Visual Studio Code
Android studio
- Bloc Code Generator
- Dart
- Flutter
9.Windows 安裝
參考:https://flutterchina.club/setup-windows/
10.其它學(xué)習(xí)資料鏈接
flutter: https://flutter.dev/docs
flutter china: https://flutterchina.club/setup-macos/
flutter API reference : https://api.flutter.dev/objcdoc/index.html
bloc: https://bloclibrary.dev/#/gettingstarted
tool: https://javiercbk.github.io/json_to_dart/
pub: https://pub.dev/
dart reference: https://api.dartlang.org/stable/2.0.0/dart-core/List-class.html
flutter go: https://github.com/alibaba/flutter-go