Flutter官网 https://flutter.dev/
Flutter中文社区 https://flutter.cn/
由于在国内访问 Flutter 有时可能会受到限制,Flutter 官方为中国开发者搭建了临时镜像,大家可以将如下环境变量加入到用户环境变量中:
PUB_HOSTED_URL=https://pub.flutter-io.cn
FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
https://flutter.cn/community/china
环境 下载 Flutter SDK// 可以从官网直接下载或使用 git 从 GitHub 上获取
git clone -b stable https://github.com/flutter/flutter.git
安装 Android Studio
安装 Flutter 和 Dart 插件
flutter命令
flutter --version:查看Flutter版本
flutter upgrade:升级 Flutter SDK,同时更新Flutter依赖包
flutter devices:查看所有设备
flutter doctor:当前环境配置信息
flutter packages get:获取项目所有依赖包
flutter channel:查看Flutter SDK所有分支
Running Gradle task ‘assembleDebug’…
修改文件android\build.gradle
// google()
// jcenter()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
修改Flutter配置文件,Flutter安装目录\packages\flutter_tools\gradle\flutter.gradle