Flutter开发环境配置

下载 Flutter SDK

下载地址:https://docs.flutter.cn/get-started/install
M1/M2芯片选择带arm64字样的Flutter SDK。

解压

cd /Applications
unzip ~/Downloads/flutter_macos_arm64_3.27.3-stable.zip

执行

/Applications/flutter/bin/flutter

Manage your Flutter app development.

Common commands:

  flutter create <output directory>
    Create a new Flutter project in the specified directory.

  flutter run [options]
    Run your Flutter application on an attached device or in an emulator.

Usage: flutter <command> [arguments]

Global options:
-h, --help                  Print this usage information.
-v, --verbose               Noisy logging, including all shell commands
                            executed.
                            If used with "--help", shows hidden options. If used
                            with "flutter doctor", shows additional diagnostic
                            information. (Use "-vv" to force verbose logging in
                            those cases.)
-d, --device-id             Target device id or name (prefixes allowed).
    --version               Reports the version of this tool.
    --enable-analytics      Enable telemetry reporting each time a flutter or
                            dart command runs.
    --disable-analytics     Disable telemetry reporting each time a flutter or
                            dart command runs, until it is re-enabled.
    --suppress-analytics    Suppress analytics reporting for the current CLI
                            invocation.

Available commands:

Flutter SDK
  bash-completion   Output command line shell completion setup scripts.
  channel           List or switch Flutter channels.
  config            Configure Flutter settings.
  doctor            Show information about the installed tooling.
  downgrade         Downgrade Flutter to the last active version for the current
                    channel.
  precache          Populate the Flutter tool's cache of binary artifacts.
  upgrade           Upgrade your copy of Flutter.

Project
  analyze           Analyze the project's Dart code.
  assemble          Assemble and build Flutter resources.
  build             Build an executable app or install bundle.
  clean             Delete the build/ and .dart_tool/ directories.
  create            Create a new Flutter project.
  drive             Run integration tests for the project on an attached device
                    or emulator.
  gen-l10n          Generate localizations for the current project.
  pub               Commands for managing Flutter packages.
  run               Run your Flutter app on an attached device.
  test              Run Flutter unit tests for the current project.

Tools & Devices
  attach            Attach to a running app.
  custom-devices    List, reset, add and delete custom devices.
  devices           List all connected devices.
  emulators         List, launch and create emulators.
  install           Install a Flutter app on an attached device.
  logs              Show log output for running Flutter apps.
  screenshot        Take a screenshot from a connected device.
  symbolize         Symbolize a stack trace from an AOT-compiled Flutter app.

Run "flutter help <command>" for more information about a command.
Run "flutter help -v" for verbose help output, including less commonly used
options.

设置代理

export http_proxy="127.0.0.1:1087"
export https_proxy="127.0.0.1:1087"
export NO_PROXY=localhost,127.0.0.1,::1

VSCode配置PATH

Windows下按快捷键Shift+Ctrl+P或MacOS下按快捷键Shift+Command+P打开命令面板,搜索install code,执行install 'code' command in PATH

Windows配置文件:cmder/config/user_profile.sh
macOS配置文件路径:~/.zprofile

code ~/.zprofile
export PATH="$PATH:/Applications/flutter/bin"

重启终端,PATH就会生效。

配置国内镜像

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE=https://storage.flutter-io.cn

# export PUB_HOSTED_URL=https://mirrors.sjtug.edu.cn
# export FLUTTER_STORAGE_BASE=https://dart-pub.mirrors.sjtug.sjtug.edu.cn

安装Rosetta

Rosetta用来把Mac下的M1/M2芯片翻译成兼容的指令。

sudo softwareupdate --install-rosetta --agree-to-license

安装Xcode

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch

配置gem镜像

# 查看镜像
gem sources

# 移除原始镜像
gem sources --remove https://rubygems.org/

# 添加阿里云镜像
gem sources -a https://mirrors.aliyun.com/rubygems/

安装cocoapods

cocoapods是Swift语言的包管理工具。

# 安装
brew install cocoapods

# 链接
brew link --overwrite cocoapods

# 查看版本
pod --version

# 升级
sudo gem install cocoapods -v 1.13.0

安装Android开发环境

下载安装Android Studio:https://developer.android.google.cn/studio?hl=zh-cn

flutter doctor --android-licenses

查看flutter健康状况

flutter doctor                       
Doctor summary (to see all details, run flutter doctor -v):
[] Flutter (Channel stable, 3.27.3, on macOS 15.3 24D60 darwin-arm64, locale
    zh-Hans-CN)
[] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[] Xcode - develop for iOS and macOS (Xcode 16.2)
[] Chrome - develop for the web
[] Android Studio (version 2024.2)
[] IntelliJ IDEA Ultimate Edition (version 2022.2)
[] VS Code (version 1.96.4)
[] VS Code (version 1.96.4)
[] Proxy Configuration
[] Connected device (4 available)
[] Network resources

• No issues found!

创建Flutter项目

cd ~/desktop
flutter create hello_world
cd ~/desktop/hello_world
code ./

1

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/963620.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

129.求根节点到叶节点数字之和(遍历思想)

Problem: 129.求根节点到叶节点数字之和 文章目录 题目描述思路复杂度Code 题目描述 思路 遍历思想(利用二叉树的先序遍历) 直接利用二叉树的先序遍历&#xff0c;将遍历过程中的节点值先利用字符串拼接起来遇到根节点时再转为数字并累加起来&#xff0c;在归的过程中&#xf…

智能小区物业管理系统打造高效智能社区服务新生态

内容概要 随着城市化进程的不断加快&#xff0c;智能小区物业管理系统的出现&#xff0c;正逐步改变传统物业管理的模式&#xff0c;为社区带来了崭新的管理理念和服务方式。该系统不仅提升了物业管理效率&#xff0c;还加强了业主与物业之间的互动&#xff0c;为每位居民提供…

本地项目上传到码云

本地项目上传到码云 写在前面1. 系统安装git环境2. 创建仓库3. 开始上传3.1 创建新的远程仓库3.2 在项目的文件夹用git打开3.3 删除本地的 .git 目录3.4 初始化新的 Git 仓库3.5 添加远程仓库3.6 添加项目文件3.7 提交更改3.8 推送到远程仓库3.9 验证 4. 完整的步骤总结写在最后…

使用 DeepSeek-R1 与 AnythingLLM 搭建本地知识库

一、下载地址Download Ollama on macOS 官方网站&#xff1a;Ollama 官方模型库&#xff1a;library 二、模型库搜索 deepseek r1 deepseek-r1:1.5b 私有化部署deepseek&#xff0c;模型库搜索 deepseek r1 运行cmd复制命令&#xff1a;ollama run deepseek-r1:1.5b 私有化…

maven mysql jdk nvm node npm 环境安装

安装JDK 1.8 11 环境 maven环境安装 打开网站 下载 下载zip格式 解压 自己创建一个maven库 以后在idea 使用maven时候重新设置一下 这三个地方分别设置 这时候maven才算设置好 nvm 管理 npm nodejs nvm下载 安装 Releases coreybutler/nvm-windows GitHub 一键安装且若有…

【大模型专栏—基础篇】智能体入门

&#x1f60a;你好&#xff0c;我是小航&#xff0c;一个正在变秃、变强的文艺倾年。 &#x1f514;本文讲解智能体入门&#xff0c;期待与你一同探索、学习、进步&#xff0c;一起卷起来叭&#xff01; &#x1f514;文章同步存在格式问题&#xff0c;还请见谅&#xff01; 目…

深入理解linux中的文件(上)

1.前置知识&#xff1a; &#xff08;1&#xff09;文章 内容 属性 &#xff08;2&#xff09;访问文件之前&#xff0c;都必须打开它&#xff08;打开文件&#xff0c;等价于把文件加载到内存中&#xff09; 如果不打开文件&#xff0c;文件就在磁盘中 &#xff08;3&am…

算法题(55):用最少数量的箭引爆气球

审题&#xff1a; 本题需要我们找到最少需要的箭数&#xff0c;并返回 思路: 首先我们需要把本题描述的问题理解准确 &#xff08;1&#xff09;arrow从x轴任一点垂直射出 &#xff08;2&#xff09;一旦射出&#xff0c;无限前进 也就是说如果气球有公共区域&#xff08;交集&…

21款炫酷烟花代码

系列专栏 《Python趣味编程》《C/C趣味编程》《HTML趣味编程》《Java趣味编程》 写在前面 Python、C/C、HTML、Java等4种语言实现21款炫酷烟花的代码。 Python Python烟花① 完整代码&#xff1a;Python动漫烟花&#xff08;完整代码&#xff09; ​ Python烟花② 完整…

【最长上升子序列Ⅱ——树状数组,二分+DP,纯DP】

题目 代码&#xff08;只给出树状数组的&#xff09; #include <bits/stdc.h> using namespace std; const int N 1e510; int n, m; int a[N], b[N], f[N], tr[N]; //f[i]表示以a[i]为尾的LIS的最大长度 void init() {sort(b1, bn1);m unique(b1, bn1) - b - 1;for(in…

k8s支持自定义field-selector spec.hostNetwork过滤

好久没写博客啦&#xff0c;年前写一个博客就算混过去啦&#x1f602; 写一个小功能&#xff0c;对于 Pod&#xff0c;在没有 label 的情况下&#xff0c;支持 --field-selector spec.hostNetwork 查询 Pod 是否为 hostNetwork 类型&#xff0c;只为了熟悉 APIServer 是如何构…

GNN-Attention——基于动态图神经网络GNN和注意力机制Attention的时间序列预测

1 数据集介绍 ETT(电变压器温度)&#xff1a;由两个小时级数据集&#xff08;ETTh&#xff09;和两个 15 分钟级数据集&#xff08;ETTm&#xff09;组成。它们中的每一个都包含 2016 年 7 月至 2018 年 7 月的七种石油和电力变压器的负载特征。 traffic(交通) &#xff1a;描…

ASP.NET Core与配置系统的集成

目录 配置系统 默认添加的配置提供者 加载命令行中的配置。 运行环境 读取方法 User Secrets 注意事项 Zack.AnyDBConfigProvider 案例 配置系统 默认添加的配置提供者 加载现有的IConfiguration。加载项目根目录下的appsettings.json。加载项目根目录下的appsettin…

c++可变参数详解

目录 引言 库的基本功能 va_start 宏: va_arg 宏 va_end 宏 va_copy 宏 使用 处理可变参数代码 C11可变参数模板 基本概念 sizeof... 运算符 包扩展 引言 在C编程中&#xff0c;处理不确定数量的参数是一个常见的需求。为了支持这种需求&#xff0c;C标准库提供了 &…

Q#使用教程

Q# 是一种用于量子计算的编程语言&#xff0c;主要用于编写量子算法。 1. 环境配置 安装vscode2017以上 QDK下载地址&#xff1a;Azure Quantum Development Kit (QDK) - Visual Studio Marketplace 将下载好的QDK作为拓展配置到vscode里面。 2.代码 import Microsoft.Qu…

万字长文深入浅出负载均衡器

前言 本篇博客主要分享Load Balancing&#xff08;负载均衡&#xff09;&#xff0c;将从以下方面循序渐进地全面展开阐述&#xff1a; 介绍什么是负载均衡介绍常见的负载均衡算法 负载均衡简介 初识负载均衡 负载均衡是系统设计中的一个关键组成部分&#xff0c;它有助于…

云原生(五十三) | SQL查询操作

文章目录 SQL查询操作 一、数据库DDL操作 1、登陆数据库 2、创建DB数据库 二、数据表DDL操作 1、创建数据表 2、RDS中SQL查询操作 三、SQL查询操作 1、RDS中SQL查询操作 SQL查询操作 一、数据库DDL操作 1、登陆数据库 2、创建DB数据库 创建一个普通账号&#xff0c…

potplayer字幕

看视频学习&#xff0c;实时字幕可以快速过滤水字数阶段&#xff0c;提高效率&#xff0c;但是容易错过一些信息。下面就是解决这一问题。 工具ptoplayer 一.生成字幕 打开学习视频&#xff0c;右键点击视频画面&#xff0c;点选字幕。勾选显示字幕。点选创建有声字幕&#…

TensorFlow简单的线性回归任务

如何使用 TensorFlow 和 Keras 创建、训练并进行预测 1. 数据准备与预处理 2. 构建模型 3. 编译模型 4. 训练模型 5. 评估模型 6. 模型应用与预测 7. 保存与加载模型 8.完整代码 1. 数据准备与预处理 我们将使用一个简单的线性回归问题&#xff0c;其中输入特征 x 和标…

langchain基础(二)

一、输出解析器&#xff08;Output Parser&#xff09; 作用&#xff1a;&#xff08;1&#xff09;让模型按照指定的格式输出&#xff1b; &#xff08;2&#xff09;解析模型输出&#xff0c;提取所需的信息 1、逗号分隔列表 CommaSeparatedListOutputParser&#xff1a;…