Flutter环境搭建mac电脑

120 阅读1分钟
  1. 获取安装包
    • git clone -b master https://github.com/flutter/flutter.git
    • 解压到跟目录,文件夹命名为flutter
  2. 添加flutter相关工具到path
    • export PATH=pwd/flutter/bin:$PATH
  3. flutter doctor 检查是否需要安装其它
  4. flutter update-packages 更新所有子依赖
  5. flutter precache 确保缓存工具是最新的
  6. flutter ide-config --overwrite 重写ide配置
  7. cd至指定目录, 创建案例
    • flutter create --template=app app_sample 创建一个简单的案例
    • flutter create --template=package package_sample 创建一个简单的安装包版
    • flutter create --template=plugin plugin_sample 创建一个简单插件版本

参考翻译: https://github.com/flutter/flutter/wiki/Flutter-Installation-Bundles