3

Flutter学习-入门

 2 years ago
source link: https://www.cnblogs.com/Tu9oh0st/p/13902518.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Flutter安装

参考官网文档即可:https://flutter.dev/docs/get-started/install

使用Flutter docter命令来检测环境配置

如果缺少某一个组建,请仔细检查一下。

使用vscode搭建项目并运行

vscode 需要使用DartFlutter插件,安装即可。

使用command + shift + p,输入Flutter new project来创建新的项目。

项目创建好之后,需要修改build.gradle中的repositories内容(如果是国内的话)。

repositories {
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
    }

此外,运行的时候还需要修改环境变量。

比如我的linux,我需要在etc/profile中添加如下

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

当项目build完成的时候

使用vscode的运行即可运行

__EOF__

本文作者: Tu9oh0st 本文链接: https://www.cnblogs.com/Tu9oh0st/p/13902518.html 关于博主: 评论和私信会在第一时间回复。或者直接私信我。 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处! 声援博主: 如果您觉得文章对您有帮助,可以点击文章右下角推荐一下。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK