STEP 0:下载 flutter
https://storage.googleapis.com/flutter_infra/releases/stable/macos/flutter_macos_1.17.1-stable.zip
解压放到你的目录目录下,将来android-studio需要配置
配置flutter为环境变量
cd ~
vim .bash_profile
添加
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=/yourflutterPath/bin:$PATH
使配置生效:source .bash_profile
STEP 1:android-studio下载
https://developer.android.com/studio/index.html
配置环境变量ANROID_HOME和platform-tools
参考STEP 0配置方式
export ANDROID_HOME=/Users/{userName}/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
STEP 2:需要安装java1.8
https://www.androiddevtools.cn/
STEP 3: android studio plugin插件:dart && flutter
plugins下商店里下载
或者手动下载https://plugins.jetbrains.com/androidstudio
在配置里找到flutter ,配置sdk地址为STEP 0里的flutter地址
STEP 4:安装dart sdk
https://dart.dev/get-dart
国内镜像安装dart:https://www.jianshu.com/p/d53531737239
前置条件:
手动下载https://storage.googleapis.com/dart-archive/channels/dev/release/2.9.0-9.0.dev/sdk/dartsdk-macos-x64-release.zip
放到/Users/{userName}/Library/Caches/Homebrew
参考:https://shockerli.net/post/homebrew-install-download-error/
运行命令:brew brew install Dart --devel
STEP 5:配置flutter maven
{flutter安装位置}/packages/flutter_tools/gradle/flutter.gradle中的
private static final String MAVEN_REPO = "https://storage.googleapis.com/download.flutter.io";
改为private static final String MAVEN_REPO = "https://storage.flutter-io.cn/download.flutter.io";
参考:https://blog.csdn.net/jikui0581/article/details/98938395
STEP 6:检查flutter 配置
运行命令:flutter doctor -v
STEP 7:创建flutter项目或导入flutter工程到ide
STEP 8:安装项目依赖
运行命令:flutter packages get
STEP 9: 点击run或debug 模拟器看效果吧
windows 安装
https://www.jb51.net/article/182714.htm
flutter学习文档:https://book.flutterchina.club/chapter1/install_flutter.html
flutter插件:http://s0pub0dev.icopy.site/dart/packages
Flutter 实战之南瓜屋故事App诞生记:https://blog.csdn.net/QiwooMobile/article/details/101444779
android开发工具相关:https://github.com/inferjay/AndroidDevTools#sdk-tools