当前位置: 首页 > news >正文

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/flutterManage 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 commandsexecuted.If used with "--help", shows hidden options. If usedwith "flutter doctor", shows additional diagnosticinformation. (Use "-vv" to force verbose logging inthose 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 ordart command runs.--disable-analytics     Disable telemetry reporting each time a flutter ordart command runs, until it is re-enabled.--suppress-analytics    Suppress analytics reporting for the current CLIinvocation.Available commands:Flutter SDKbash-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 currentchannel.precache          Populate the Flutter tool's cache of binary artifacts.upgrade           Upgrade your copy of Flutter.Projectanalyze           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 deviceor 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 & Devicesattach            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, localezh-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

相关文章:

Flutter开发环境配置

下载 Flutter SDK 下载地址&#xff1a;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/flutterManage your Flut…...

Two Divisors ( Educational Codeforces Round 89 (Rated for Div. 2) )

Two Divisors &#xff08; Educational Codeforces Round 89 (Rated for Div. 2) &#xff09; You are given n n n integers a 1 , a 2 , … , a n a_1, a_2, \dots, a_n a1​,a2​,…,an​. For each a i a_i ai​ find its two divisors d 1 > 1 d_1 > 1 d1​…...

亚博microros小车-原生ubuntu支持系列:17 gmapping

前置依赖 先看下亚博官网的介绍 Gmapping简介 gmapping只适用于单帧二维激光点数小于1440的点&#xff0c;如果单帧激光点数大于1440&#xff0c;那么就会出【[mapping-4] process has died】 这样的问题。 Gmapping是基于滤波SLAM框架的常用开源SLAM算法。 Gmapping基于RBp…...

Java面试题2025-并发编程进阶(线程池和并发容器类)

线程池 一、什么是线程池 为什么要使用线程池 在开发中&#xff0c;为了提升效率的操作&#xff0c;我们需要将一些业务采用多线程的方式去执行。 比如有一个比较大的任务&#xff0c;可以将任务分成几块&#xff0c;分别交给几个线程去执行&#xff0c;最终做一个汇总就可…...

Stable Diffusion 3.5 介绍

Stable Diffusion 3.5 是由 Stability AI 推出的最新一代图像生成模型&#xff0c;是 Stable Diffusion 系列的重要升级版本。以下是关于 Stable Diffusion 3.5 的详细信息&#xff1a; 版本概述 Stable Diffusion 3.5 包含三个主要版本&#xff1a; Stable Diffusion 3.5 L…...

云计算部署模式全面解析

目录 引言公有云私有云混合云三种部署模式的对比选择建议未来趋势结语 1. 引言 随着云计算技术的快速发展,企业在选择云部署模式时面临着多种选择。本文将深入探讨云计算的三种主要部署模式:公有云、私有云和混合云,帮助读者全面了解它们的特点、优势及适用场景。 © iv…...

Vue 与 Electron 结合开发桌面应用

1. 引言 1.1 什么是 Electron? Electron 是一个使用 JavaScript、HTML 和 CSS 构建跨平台桌面应用程序的框架。它结合了 Chromium 渲染引擎和 Node.js 运行时,使得开发者可以使用 Web 技术创建原生桌面应用。1.2 为什么选择 Vue.js 和 Electron? Vue.js 是一个渐进式 JavaSc…...

数据库优化:提升性能的关键策略

1. 引言 在后端开发中&#xff0c;数据库的性能直接影响系统的稳定性和响应速度。随着业务增长&#xff0c;数据库查询变慢、负载过高等问题可能会影响用户体验。 本文将介绍数据库优化的关键策略&#xff0c;包括索引优化、查询优化、分库分表、缓存机制等&#xff0c;并结合…...

使用openAI与Deepseek的感受

今天简单介绍下使用OpenAI和DeepSeek的感觉&#xff0c;有些地方可能存在不准确的地方&#xff0c;望指正&#xff1a; 从2023年的秋冬到现在2025年的1月间&#xff0c;OpenAI和DeepSeek我都用它们来帮我&#xff0c;当然更多的是OpenAI&#xff0c;但整体感受如下&#xff1a;…...

pytorch实现长短期记忆网络 (LSTM)

人工智能例子汇总&#xff1a;AI常见的算法和例子-CSDN博客 LSTM 通过 记忆单元&#xff08;cell&#xff09; 和 三个门控机制&#xff08;遗忘门、输入门、输出门&#xff09;来控制信息流&#xff1a; 记忆单元&#xff08;Cell State&#xff09; 负责存储长期信息&…...

【ubuntu】双系统ubuntu下一键切换到Windows

ubuntu下一键切换到Windows 1.4.1 重启脚本1.4.2 快捷方式1.4.3 移动快捷方式到系统目录 按前文所述文档&#xff0c;开机默认启动ubuntu。Windows切换到Ubuntu直接重启就行了&#xff0c;而Ubuntu切换到Windows稍微有点麻烦。可编辑切换重启到Windows的快捷方式。 1.4.1 重启…...

【PyTorch】6.张量形状操作:在深度学习的 “魔方” 里,玩转张量形状

目录 1. reshape 函数的用法 2. transpose 和 permute 函数的使用 4. squeeze 和 unsqueeze 函数的用法 5. 小节 个人主页&#xff1a;Icomi 专栏地址&#xff1a;PyTorch入门 在深度学习蓬勃发展的当下&#xff0c;PyTorch 是不可或缺的工具。它作为强大的深度学习框架&am…...

大模型GUI系列论文阅读 DAY4续:《Large Language Model Agent for Fake News Detection》

摘要 在当前的数字时代&#xff0c;在线平台上虚假信息的迅速传播对社会福祉、公众信任和民主进程构成了重大挑战&#xff0c;并影响着关键决策和公众舆论。为应对这些挑战&#xff0c;自动化假新闻检测机制的需求日益增长。 预训练的大型语言模型&#xff08;LLMs&#xff0…...

论文阅读(九):通过概率图模型建立连锁不平衡模型和进行关联研究:最新进展访问之旅

1.论文链接&#xff1a;Modeling Linkage Disequilibrium and Performing Association Studies through Probabilistic Graphical Models: a Visiting Tour of Recent Advances 摘要&#xff1a; 本章对概率图模型&#xff08;PGMs&#xff09;的最新进展进行了深入的回顾&…...

python小知识-typing注解你的程序

python小知识-typing注解你的程序 1. Typing的简介 typing 是 Python 的一个标准库&#xff0c;它提供了类型注解的支持&#xff0c;但并不会强制类型检查。类型注解在 Python 3.5 中引入&#xff0c;并在后续版本中得到了增强和扩展。typing 库允许开发者为变量、函数参数和…...

git基础使用--1--版本控制的基本概念

git基础使用–1–版本控制的基本概念 1.版本控制的需求背景&#xff0c;即为啥需要版本控制 先说啥叫版本&#xff0c;这个就不多说了吧&#xff0c;我们写代码的时候肯定不可能一蹴而就&#xff0c;肯定是今天写一点&#xff0c;明天写一点&#xff0c;对于项目来讲&#xff…...

“新月智能武器系统”CIWS,开启智能武器的新纪元

新月人物传记&#xff1a;人物传记之新月篇-CSDN博客 相关文章链接&#xff1a;星际战争模拟系统&#xff1a;新月的编程之道-CSDN博客 新月智能护甲系统CMIA--未来战场的守护者-CSDN博客 “新月之智”智能战术头盔系统&#xff08;CITHS&#xff09;-CSDN博客 目录 智能武…...

JVM运行时数据区域-附面试题

Java虚拟机在执行Java程序的过程中会把它所管理的内存划分为若干个不同的数据区域。这些区域 有各自的用途&#xff0c;以及创建和销毁的时间&#xff0c;有的区域随着虚拟机进程的启动而一直存在&#xff0c;有些区域则是 依赖用户线程的启动和结束而建立和销毁。 1. 程序计…...

增删改查(CRUD)操作

文章目录 MySQL系列&#xff1a;1.CRUD简介2.Create(创建)2.1单行数据全列插入2.2 单行数据指定插入2.3 多⾏数据指定列插⼊ 3.Retrieve(读取)3.1 Select查询3.1.1 全列查询3.1.2 指定列查询3.1.3 查询字段为表达式&#xff08;都是临时表不会对原有表数据产生影响&#xff09;…...

Vue.js `Suspense` 和异步组件加载

Vue.js Suspense 和异步组件加载 今天我们来聊聊 Vue 3 中的一个强大特性&#xff1a;<Suspense> 组件&#xff0c;以及它如何帮助我们更优雅地处理异步组件加载。如果你曾在 Vue 项目中处理过异步组件加载&#xff0c;那么这篇文章将为你介绍一种更简洁高效的方式。 什…...

[特殊字符] 智能合约中的数据是如何在区块链中保持一致的?

&#x1f9e0; 智能合约中的数据是如何在区块链中保持一致的&#xff1f; 为什么所有区块链节点都能得出相同结果&#xff1f;合约调用这么复杂&#xff0c;状态真能保持一致吗&#xff1f;本篇带你从底层视角理解“状态一致性”的真相。 一、智能合约的数据存储在哪里&#xf…...

【根据当天日期输出明天的日期(需对闰年做判定)。】2022-5-15

缘由根据当天日期输出明天的日期(需对闰年做判定)。日期类型结构体如下&#xff1a; struct data{ int year; int month; int day;};-编程语言-CSDN问答 struct mdata{ int year; int month; int day; }mdata; int 天数(int year, int month) {switch (month){case 1: case 3:…...

【kafka】Golang实现分布式Masscan任务调度系统

要求&#xff1a; 输出两个程序&#xff0c;一个命令行程序&#xff08;命令行参数用flag&#xff09;和一个服务端程序。 命令行程序支持通过命令行参数配置下发IP或IP段、端口、扫描带宽&#xff0c;然后将消息推送到kafka里面。 服务端程序&#xff1a; 从kafka消费者接收…...

【Java学习笔记】Arrays类

Arrays 类 1. 导入包&#xff1a;import java.util.Arrays 2. 常用方法一览表 方法描述Arrays.toString()返回数组的字符串形式Arrays.sort()排序&#xff08;自然排序和定制排序&#xff09;Arrays.binarySearch()通过二分搜索法进行查找&#xff08;前提&#xff1a;数组是…...

QMC5883L的驱动

简介 本篇文章的代码已经上传到了github上面&#xff0c;开源代码 作为一个电子罗盘模块&#xff0c;我们可以通过I2C从中获取偏航角yaw&#xff0c;相对于六轴陀螺仪的yaw&#xff0c;qmc5883l几乎不会零飘并且成本较低。 参考资料 QMC5883L磁场传感器驱动 QMC5883L磁力计…...

线程同步:确保多线程程序的安全与高效!

全文目录&#xff1a; 开篇语前序前言第一部分&#xff1a;线程同步的概念与问题1.1 线程同步的概念1.2 线程同步的问题1.3 线程同步的解决方案 第二部分&#xff1a;synchronized关键字的使用2.1 使用 synchronized修饰方法2.2 使用 synchronized修饰代码块 第三部分&#xff…...

令牌桶 滑动窗口->限流 分布式信号量->限并发的原理 lua脚本分析介绍

文章目录 前言限流限制并发的实际理解限流令牌桶代码实现结果分析令牌桶lua的模拟实现原理总结&#xff1a; 滑动窗口代码实现结果分析lua脚本原理解析 限并发分布式信号量代码实现结果分析lua脚本实现原理 双注解去实现限流 并发结果分析&#xff1a; 实际业务去理解体会统一注…...

Spring数据访问模块设计

前面我们已经完成了IoC和web模块的设计&#xff0c;聪明的码友立马就知道了&#xff0c;该到数据访问模块了&#xff0c;要不就这俩玩个6啊&#xff0c;查库势在必行&#xff0c;至此&#xff0c;它来了。 一、核心设计理念 1、痛点在哪 应用离不开数据&#xff08;数据库、No…...

关键领域软件测试的突围之路:如何破解安全与效率的平衡难题

在数字化浪潮席卷全球的今天&#xff0c;软件系统已成为国家关键领域的核心战斗力。不同于普通商业软件&#xff0c;这些承载着国家安全使命的软件系统面临着前所未有的质量挑战——如何在确保绝对安全的前提下&#xff0c;实现高效测试与快速迭代&#xff1f;这一命题正考验着…...

Docker 本地安装 mysql 数据库

Docker: Accelerated Container Application Development 下载对应操作系统版本的 docker &#xff1b;并安装。 基础操作不再赘述。 打开 macOS 终端&#xff0c;开始 docker 安装mysql之旅 第一步 docker search mysql 》〉docker search mysql NAME DE…...