Flutter笔记flutter安装环境配置检测及命令创建flutter项目
# 更新系统包索引
sudo apt-get update
# 安装Flutter所需依赖
sudo apt-get install clang cmake gnupg lib32ncurses5-dev lib32stdc++6 libcurl4-openssl-dev libelf-dev libftdi-dev libgl1-mesa-dev libglu1-mesa-dev libicu-dev liblzma-dev libncurses5-dev libnss3-dev libpci-dev libssl-dev libts-dev libx11-dev libx11-xcb-dev libxcb1-dev libxml2-utils pkg-config rsync
# 下载Flutter SDK
wget https://storage.googleapis.com/flutter_infra/releases/stable/linux/flutter_linux_2.0.0-stable.tar.xz
# 解压Flutter SDK
tar -xf flutter_linux_2.0.0-stable.tar.xz
# 配置环境变量
export PATH="$PATH:`pwd`/flutter/bin"
# 将环境变量添加到用户的profile中,使得环境变量更改在重启后依然有效
echo "export PATH=\$PATH:`pwd`/flutter/bin" >> ~/.profile
# 应用环境变量更改
source ~/.profile
# 检查Flutter安装是否成功
flutter doctor
# 创建一个flutter项目
flutter create my_flutter_app
这段代码展示了如何在Linux环境下安装和配置Flutter环境,并检查安装是否成功。然后,它创建了一个名为my_flutter_app
的Flutter项目。这是学习Flutter开发的一个基本入门步骤。
评论已关闭