Flutter 环境搭建
Posted 伟雪无痕
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Flutter 环境搭建相关的知识,希望对你有一定的参考价值。
一,flutter简介
Flutter是google开发的移动UI框架,可快速的构建移动端app,高效的在android和ios平台运行,使用的开发语言是dart,目前正在被越来越多的开发者学习和使用,且flutter框架和android一样,是免费和开源的,框架图如下:
二,环境搭建,可参考官网链接,此处以Windows为例
1.下载SDK releases
2.将下载的SDK解压到自己的硬盘,并通过命令flutter --version查看版本,eg:
F:\\Program_Files\\flutter\\bin>flutter --version
Flutter 2.6.0-0.0.pre • channel dev • https://github.com/flutter/flutter.git
Framework • revision 83b9e99cfb (3 months ago) • 2021-08-23 19:03:21 +0200
Engine • revision d5adde01dd
Tools • Dart 2.15.0 (build 2.15.0-42.0.dev)
3.环境变量配置,这里已window10为例,右键点击我的电脑->属性->高级系统设置->环境变量
1).新建用户变量
变量名:FLUTTER_STORAGE_BASE_URL
变量值:https://storage.flutter-io.cn
2).编辑环境变量path中添加新配置: eg:F:\\Program_Files\\flutter\\bin
3).通过命令flutter doctor,查看是否配置成功
C:\\Users\\17990>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel dev, 2.6.0-0.0.pre, on Microsoft Windows [Version 10.0.19042.1288], locale zh-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
X cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[√] Android Studio (version 3.5)
[√] Android Studio (version 4.0)
[√] Connected device (3 available)
! Doctor found issues in 1 category.
4.android studio中添加dart和flutter插件,如果没有android studio工具,可在此处下载android studio IDE
步骤:eg: 开启android studio —> File —>Settings —>Plugins,搜索dart和flutter,点击install即可
5.创建自己的flutter project
步骤: eg: File—>New—>New Flutter Project
san
三,flutter优秀学习网站
四 ,flutter插件
五,上面是总结的一些优秀的资源和网站,希望和大家一起学习交流,共同进步。
以上是关于Flutter 环境搭建的主要内容,如果未能解决你的问题,请参考以下文章