flutter sdk层, 引擎层,潜入层.这里我们所说的通常都是sdk层
一:flutter 基本环境和安装
flutter sdk源码
Flutter SDK releases | Flutter
flutter 国外,强了无法访问,一般需要添加国内临时镜像
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
具体安装这里就不再说了,见地址1.3 搭建Flutter开发环境 | 《Flutter实战·第二版》
二:flutter升级和更新
1.flutter channel 查看flutter sdk代码分支,一般用stable稳定分支,也可以用master,但是没那么稳定,好处是可以知道最新更新内容
2.更新flutter代码和依赖包
flutter upgrade
flutter packages get 获取项目所有的依赖包
flutter packages upgrade 获取项目所有依赖包的最新版本
flutter遇到问题:
1.好久没玩flutter了,最近flutter doctor 报错 fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. Use '--' to separate paths from revisions
git reflog 也没啥修改的历史记录.
解决方式 : 在flutter目录下 : git commit --allow-empty -n -m "Initial commit"就可以了.
2. flutter doctor 执行提示
flutter/bin/internal/shared.sh: line 225: flutter/bin/cache/dart-sdk/bin/dart: Bad CPU type in executable
uname -a 查询下自己电脑cpu架构是x64还是arm.下载对应sdk既可以.