Flutter环境配置
Flutter官网 https://flutterchina.club/
Flutter下载
image.png
image.png
image.png
image.png
配置国内镜像
image.png
image.png
配置Flutter环境变量
image.png
运行Flutter命令
win + R 快捷键,输入cmd,回车,输入flutter doctor,回车。
Windows PowerShell版权所有 (C) Microsoft Corporation。保留所有权利。PS C:\Users\boy> flutter doctorDoctor summary (to see all details, run flutter doctor -v):[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17134.590], locale zh-CN)[X] Android toolchain - develop for Android devices X Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.io/setup/#android-setup for detailed instructions). If Android SDK has been installed to a custom location, set ANDROID_HOME to that location. You may also want to add it to your PATH environment variable.[!] Android Studio (not installed)[!] Connected device ! No devices available! Doctor found issues in 3 categories.PS C:\Users\boy> ^CPS C:\Users\boy>报错
[X] If Android SDK has been installed to a custom location, set ANDROID_HOME to that location. You may also want to add it to your PATH environment variable.处理问题
配置ANDROID_HOME环境变量并且增加到path
image.png
image.png
运行 flutter doctor
Windows PowerShell版权所有 (C) Microsoft Corporation。保留所有权利。PS C:\Users\boy> flutter doctorDoctor summary (to see all details, run flutter doctor -v):[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17134.590], locale zh-CN)[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)[!] Android Studio (not installed)[!] Connected device ! No devices available报错
[!] Android Studio (not installed)处理方案:下载最新的Android Studio,自行安装就可。
https://developer.android.google.cn/studio
运行 flutter doctor
Windows PowerShell版权所有 (C) Microsoft Corporation。保留所有权利。PS C:\Users\boy> flutter doctorDoctor summary (to see all details, run flutter doctor -v):[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17134.590], locale zh-CN)[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)[!] Android Studio (version 3.3) X Flutter plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality.[!] IntelliJ IDEA Ultimate Edition (version 2018.2) X Flutter plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality.[√] Connected device (1 available)报错
[!] Android Studio (version 3.3) X Flutter plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality.处理方案
需要安装两个插件:
- Flutter插件: 支持Flutter开发工作流 (运行、调试、热重载等).
- Dart插件: 提供代码分析 (输入代码时进行验证、代码补全等).
要安装这些:
启动Android Studio.
- 打开插件首选项 (Preferences>Plugins on macOS, File>Settings>Plugins on Windows & Linux).
- 选择 Browse repositories…, 选择 Flutter 插件并点击 install.
- 重启Android Studio后插件生效.
具体安装如下:
image.png
运行 flutter doctor
Windows PowerShell版权所有 (C) Microsoft Corporation。保留所有权利。PS C:\Users\boy> flutter doctorDoctor summary (to see all details, run flutter doctor -v):[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17134.590], locale zh-CN)[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)[√] Android Studio (version 3.3)[!] IntelliJ IDEA Ultimate Edition (version 2018.2) X Flutter plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality.[√] Connected device (1 available)! Doctor found issues in 1 category.[!] IntelliJ IDEA Ultimate Edition (version 2018.2)这个是IntelliJ IDEA编译器,我们只需Android Studio可用就好,大家忽视就好。
创立Flutter项目
image.png
image.png
image.png
image.png
运行Flutter工程

说明
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是摆设,本站源码仅提供给会员学习使用!
7. 如遇到加密压缩包,请使用360解压,如遇到无法解压的请联系管理员
开心源码网 » Flutter环境配置
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是摆设,本站源码仅提供给会员学习使用!
7. 如遇到加密压缩包,请使用360解压,如遇到无法解压的请联系管理员
开心源码网 » Flutter环境配置