Flutter环境搭建

Stella981
• 阅读 946

本文介绍mac上搭建Flutter环境

1、Flutter官方提供中国地区镜像地址:https://github.com/flutter/flutter/wiki/Using-Flutter-in-China

2、下载Flutter源码 (官方建议下载beta分支)

git clone -b beta https://github.com/flutter/flutter.git

3、环境配置

  进入home目录 cd ~ , open -e .bash_profile(没有``bash_profile文件,就创建一个touch .bash_profile``)

  export PUB_HOSTED_URL=https://pub.flutter-io.cn
  export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
  export PATH="/Users/MacBook/flutter/bin:$PATH"

  注:

    1、Run source $HOME/.bash_profile to refresh the current window.

    2、__其中/Users/MacBook/flutter/bin就是刚刚下载的Flutter的bin目录__

4、使用flutter doctor 命令进行安装

cd ./flutter
flutter doctor稍等片刻就会出现如下界面就会安装成功

Downloading Dart SDK from Flutter engine e3687f70c7ece72000b32ee1b3c02755ba5361ac...

% Total % Received % Xferd Average Speed   Time Time     Time Current

Dload Upload   Total   Spent Left Speed

100 87.9M 100 87.9M 0     0 4247k 0 0:00:21 0:00:21 --:--:-- 4945k

Building flutter tool...

╔════════════════════════════════════════════════════════════════════════════╗

║                 Welcome to Flutter! - https://flutter.io                   ║

║ ║

║ The Flutter tool anonymously reports feature usage statistics and crash ║

║ reports to Google in order to help Google contribute improvements to       ║

║ Flutter over time.                                                         ║

║ ║

║ Read about data we send with crash reports: ║

https://github.com/flutter/flutter/wiki/Flutter-CLI-crash-reporting

║ ║

║ See Google's privacy policy:                                               ║

https://www.google.com/intl/en/policies/privacy/                           ║

║ ║

║ Use "flutter config --no-analytics" to disable analytics and crash         ║

║ reporting.                                                                 ║

╚════════════════════════════════════════════════════════════════════════════╝

Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!

Downloading Material fonts... 0.6s

Downloading package sky_engine... 0.3s

Downloading common tools... 0.8s

Downloading darwin-x64 tools... 3.4s

Downloading android-arm-profile/darwin-x64 tools... 0.6s

Downloading android-arm-release/darwin-x64 tools... 0.7s

Downloading android-arm64-profile/darwin-x64 tools... 0.6s

Downloading android-arm64-release/darwin-x64 tools... 0.6s

Downloading android-x86 tools...                             1.9s

Downloading android-x64 tools...                             2.4s

Downloading android-arm tools...                             1.2s

Downloading android-arm-profile tools...                     0.9s

Downloading android-arm-release tools...                     0.7s

Downloading android-arm64 tools...                           1.1s

Downloading android-arm64-profile tools...                   1.0s

Downloading android-arm64-release tools...                   0.8s

Downloading ios tools...                                     4.3s

Downloading ios-profile tools...                             3.7s

Downloading ios-release tools...                             3.2s

Downloading Gradle Wrapper... 0.1s

Doctor summary (to see all details, run flutter doctor -v):

[✓] Flutter (Channel beta, v0.6.0, on Mac OS X 10.12.6 16G1510, locale zh-Hans-CN)

[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)

! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[✗] iOS toolchain - develop for iOS devices

✗ Xcode installation is incomplete; a full installation is necessary for iOS development.

Download at: https://developer.apple.com/xcode/download/

Or install Xcode via the App Store.

Once installed, run:

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

✗ Brew not installed; use this to install tools for iOS device development.

Download brew at https://brew.sh/.

[✓] Android Studio (version 3.0)

✗ Flutter plugin not installed; this adds Flutter specific functionality.

✗ Dart plugin not installed; this adds Dart specific functionality.

[!] Connected devices

! No devices available

! Doctor found issues in 3 categories.

5、安装androidsudio的Flutter插件

Flutter环境搭建

6、使用androidsudio建立Flutter项目

Flutter环境搭建

 到此Futtler环境就搭建好了,希望能够帮助到您!附上成功的效果图

Flutter环境搭建

点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
待兔 待兔
5个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Jacquelyn38 Jacquelyn38
3年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
Wesley13 Wesley13
3年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
3年前
Java日期时间API系列36
  十二时辰,古代劳动人民把一昼夜划分成十二个时段,每一个时段叫一个时辰。二十四小时和十二时辰对照表:时辰时间24时制子时深夜11:00凌晨01:0023:0001:00丑时上午01:00上午03:0001:0003:00寅时上午03:00上午0
Wesley13 Wesley13
3年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Wesley13 Wesley13
3年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
11个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这
田楷 田楷
3星期前
鸿蒙Flutter实战:08-如何调试代码
鸿蒙Flutter实战:如何调试代码1.环境搭建参考文章搭建好开发环境。IDE安装好DevEco和VsCode/AndroidStudio。2.配置如果是vscode,可以在.vscode/launch.json文件中,增加以下配置json"name":"