2018-03-12 Flutter初体验

Flutter的安装指南

Flutter的安装可以参考官方的文档,我这以windows为例,首先clone flutter的的源码,选择beta版本,这是最近才更新的:

  1. git clone -b beta https://github.com/flutter/flutter.git
  2. 配置PATH目录。
    把flutter目录下的bin加到PATH的系统目录里面。打开cmd 输入flutter,看看是否会出现flutter有关的信息,这
    里需要注意一点的就是你必须把git的exe文件也添加到系统的PATH的目录里面要不这里会提示你找不到git程
    序。
  3. 执行命令flutter doctor。
    犹豫特殊环境有可能被墙了所以需要多试几次。执行成功的话就会出现类似这样的结果:
flutter renyugang$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.1.5, on Mac OS X 10.11.1 15B42, locale zh-Hans)
[✓] Android toolchain - develop for Android devices (Android SDK 26.0.2)
[!] iOS toolchain - develop for iOS devices (Xcode 7.3.1)
    ✗ Flutter requires a minimum Xcode version of 9.0.0.
      Download the latest version or update via the Mac App Store.
    ✗ libimobiledevice and ideviceinstaller are not installed. To install, run:
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    ✗ ios-deploy not installed. To install:
        brew install ios-deploy
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
        For more info, see https://flutter.io/platform-plugins
      To install:
        brew install cocoapods
        pod setup
[✓] Android Studio (version 3.0)
[✓] IntelliJ IDEA Community Edition (version 2017.3.1)
[✓] Connected devices (1 available)
! Doctor found issues in 1 category.
  1. 打开Android Studio选择File---new project---new Flutter project----flutter Application点击next,到这一步会让你选择Flutter的sdk如果flutter doctor执行成功的话这里的sdk就会自动填上如果没成功则不能接着往下执行。然后点击finish,到这里工程就已经建完了。
    最后说一点就是android sdk的问题如果你需要改变默认的sdk的目录的话就得在local.properties里面修改如图:



    修改后打开模拟器,点击运行。

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,870评论 19 139
  • 用到的组件 1、通过CocoaPods安装 2、第三方类库安装 3、第三方服务 友盟社会化分享组件 友盟用户反馈 ...
    SunnyLeong阅读 15,278评论 1 180
  • 随着民间美食届的兴起,按图索骥的吃过好多家藏于四处的锅边店。好吃是好吃,但是靠精细食材煮出来的锅边变得登堂入室而少...
    假装冻龄妹阅读 847评论 0 0
  • 旧时,凤庄有一富贾,名叫唐福,幼年时家境破落,穷困潦倒,但他志向高远,又聪慧有机智,在县里布庄帮工,学有所成,之后...
    小黑说阅读 399评论 0 0
  • 八月 昼夜颠倒 无比漫长 八月 将要死去的人不知自己快要死去 活着的人为她默默心酸 她依然兴奋地 和别人谈论着些什...
    天生好果阅读 242评论 0 1

友情链接更多精彩内容