发表日期:2018-06 文章编辑:小灯 浏览次数:4261
关于Flutter的安装其实超级简单,不想看此文的可以直接跳官网
这篇主要是简单版的Flutter安装配置,写了:
cd ~ && mkdir development
,不过你也可以在$Home/Library下保存fluttercd development && unzip ~/Downloads/flutter_macos_v0.5.1-beta.zip
,如果你要保存在 $Home/Library 下的话,cd $Home/Library && unzip ~/Downloads/flutter_macos_v0.5.1-beta.zip
在你的shell rc文件中添加环境变量如果是zsh的话 cd ~ && vim .zshrc
然后添加 export FLUTTER=$HOME/development/flutter/bin
并在 PATH 目录中添加 :$FLUTTER
如果是bash的话,在$HOME/.bash_profile添加
vim $HOME/.bash_profile
新建一个shell 窗口测试一下Flutter flutter doctor
这个命令会显示你当前的flutter的版本信息及flutter开发环境信息,如果有任何需要安装的信息都会显示在上面。
$ flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.5 17F77, locale en-NZ) [!] Android toolchain - develop for Android devices (Android SDK 26.0.2) ! Some Android licenses not accepted.To resolve this, run: flutter doctor --android-licenses [!] iOS toolchain - develop for iOS devices (Xcode 9.4.1) ✗ Missing Xcode dependency: Python module "six". Install via 'pip install six' or 'sudo easy_install six'. ✗ 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 ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. [✓] Android Studio (version 3.0) ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. [!] IntelliJ IDEA Ultimate Edition (version 2017.1.1) ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. [!] VS Code (version 1.24.1) [!] Connected devices ! No devices available! Doctor found issues in 5 categories.
安装Android Studio及Xcode
如果已安装好Android Studio,请检查SDK有没有配置环境变量echo $ANDROID_HOME
,如果没有的话请添加export ANDROID_HOME=$HOME/Library/Android/sdk
vscode 下 command + shift + p 输入 flutter 选择 Flutter:New Project 输入项目名称 myapp
创建插件创建完项目之后可以看到lib下main.dart
就是整个项目的源码,可以按F5运行项目
像前文提到的Flutter支持Hot reload,改动代码后直接command + s就可以生效了,可以更改_counter++
试试
喜欢的小伙伴可以关注我的公众号AllAboutCoding
日期:2018-10 浏览次数:7536
日期:2018-12 浏览次数:4615
日期:2018-07 浏览次数:5130
日期:2018-12 浏览次数:4409
日期:2018-09 浏览次数:5767
日期:2018-12 浏览次数:10191
日期:2018-11 浏览次数:5099
日期:2018-07 浏览次数:4850
日期:2018-05 浏览次数:5112
日期:2018-12 浏览次数:4577
日期:2018-10 浏览次数:5384
日期:2018-12 浏览次数:6451
日期:2018-11 浏览次数:4712
日期:2018-08 浏览次数:4862
日期:2018-11 浏览次数:12957
日期:2018-09 浏览次数:5870
日期:2018-12 浏览次数:5091
日期:2018-10 浏览次数:4435
日期:2018-11 浏览次数:4786
日期:2018-12 浏览次数:6314
日期:2018-06 浏览次数:4260
日期:2018-08 浏览次数:5709
日期:2018-10 浏览次数:4695
日期:2018-12 浏览次数:4807
日期:2018-07 浏览次数:4626
日期:2018-12 浏览次数:4798
日期:2018-06 浏览次数:4633
日期:2018-11 浏览次数:4613
日期:2018-12 浏览次数:4541
日期:2018-12 浏览次数:5522
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.