Flutter开发环境配置

1.按照官方文档的安装dart语言

Install using a Linux package manager

#

You have two options to install the Dart SDK on Ubuntu or Debian:

  • Use the apt-get command.
  • Download a .deb package and run the dpkg command.

Install using the apt-get package manager

#

To install Dart with apt-get, perform the following steps. You need steps 1 to 3 only for the first install.

  1. Update the package index files and install the secure HTTP package.

    复制代码
    $ sudo apt-get update && sudo apt-get install apt-transport-https

    content_copy

  2. Download and add the Google Linux GPG public key.

    复制代码
    $ wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub \
      | sudo gpg  --dearmor -o /usr/share/keyrings/dart.gpg

    content_copy

  3. Add the Dart package repository to your Linux system.

    复制代码
    $ echo 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' \
      | sudo tee /etc/apt/sources.list.d/dart_stable.list

    content_copy

  4. Use the following sudo apt-get commands.

    复制代码
    $ sudo apt-get update && sudo apt-get install dart

dart --version 可以看到dart安装的版本 dart sdk 存储路径在/user/lib/dart

二、下载 https://dart.dev/get-dart flutter sdk 解压下 比如放在这个目录下/home/denghg/Flutter/flutter

三、添加flutter 到linux的环境变量下 这里有个坑flutter的环境变量得在系统PATH的前面

复制代码
export FLUTTER_PATH=/home/denghg/Flutter/flutter/bin
export PATH=$FLUTTER_PATH:$PATH:$JAVA_HOME:$ANDROID_NDK:$ANDROID_SDK:$ANDROID_HOME:$CMAKE_PATH:$DEPOT_TOOL:$NODE_PATH:$GOROOT:$GOPATH:$NGINX:$GOPROXY:$FFMPEG_PATH:$SVG_PATH:$SHELL_PATH

flutter sdk 跟dartsdk是两个不同的东西 dart 是一份语言sdk flutter是一个框架调用dart语言所以两个都要。

四、 android studio plugin 安装Flutter插件 然后配置Flutter sdk位置

然后运行flutter doctor验证环境配置 根据提示的问题修改

比如缺少android command-line tools

新建flutter项目参考这篇文章

Android studio配置Flutter(看这一篇就够了)_android studio flutter-CSDN博客

相关推荐
yeziyfx5 小时前
Flutter开发环境vs code报错
flutter
西西学代码6 小时前
flutter_blue_plus
flutter
tangweiguo030519877 小时前
Flutter MVVM 完整实战:网络请求、状态管理、分页加载一网打尽
flutter
孤影过客8 小时前
Flutter优雅构建:从零打造开发级工作流
arm开发·数据库·flutter
p1gd0g9 小时前
flutter web 如何确保用户收到更新
flutter
GoCoding10 小时前
Flutter ngspice 插件
flutter
恋猫de小郭10 小时前
Android Studio Panda 2 ,支持 AI 用 Vibe Coding 创建项目
android·前端·flutter
Gorit12 小时前
如何使用 Flutter 开发 HarmonyOS 应用
flutter·华为·harmonyos
孤影过客12 小时前
Flutter高性能任务管理APP开发实战代码解析
jvm·flutter·oracle
键盘鼓手苏苏1 天前
Flutter 三方库 p2plib 的鸿蒙化适配指南 - 实现高性能的端到端(P2P)加密通讯、支持分布式节点发现与去中心化数据流传输实战
flutter·harmonyos·鸿蒙·openharmony