发表日期:2018-06 文章编辑:小灯 浏览次数:4273
关于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 浏览次数:7551
日期:2018-12 浏览次数:4636
日期:2018-07 浏览次数:5146
日期:2018-12 浏览次数:4425
日期:2018-09 浏览次数:5788
日期:2018-12 浏览次数:10206
日期:2018-11 浏览次数:5119
日期:2018-07 浏览次数:4866
日期:2018-05 浏览次数:5124
日期:2018-12 浏览次数:4596
日期:2018-10 浏览次数:5402
日期:2018-12 浏览次数:6470
日期:2018-11 浏览次数:4724
日期:2018-08 浏览次数:4877
日期:2018-11 浏览次数:13027
日期:2018-09 浏览次数:5890
日期:2018-12 浏览次数:5106
日期:2018-10 浏览次数:4452
日期:2018-11 浏览次数:4804
日期:2018-12 浏览次数:6329
日期:2018-06 浏览次数:4272
日期:2018-08 浏览次数:5718
日期:2018-10 浏览次数:4709
日期:2018-12 浏览次数:4828
日期:2018-07 浏览次数:4638
日期:2018-12 浏览次数:4812
日期:2018-06 浏览次数:4643
日期:2018-11 浏览次数:4628
日期:2018-12 浏览次数:4564
日期:2018-12 浏览次数:5540
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.