發(fā)表日期:2018-06 文章編輯:小燈 瀏覽次數(shù):4132
關(guān)于Flutter的安裝其實超級簡單,不想看此文的可以直接跳官網(wǎng)
這篇主要是簡單版的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文件中添加環(huán)境變量如果是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開發(fā)環(huán)境信息,如果有任何需要安裝的信息都會顯示在上面。
$ 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有沒有配置環(huán)境變量echo $ANDROID_HOME
,如果沒有的話請?zhí)砑?code>export ANDROID_HOME=$HOME/Library/Android/sdk
vscode 下 command + shift + p 輸入 flutter 選擇 Flutter:New Project 輸入項目名稱 myapp
創(chuàng)建插件創(chuàng)建完項目之后可以看到lib下main.dart
就是整個項目的源碼,可以按F5運行項目
像前文提到的Flutter支持Hot reload,改動代碼后直接command + s就可以生效了,可以更改_counter++
試試
喜歡的小伙伴可以關(guān)注我的公眾號AllAboutCoding
日期:2018-10 瀏覽次數(shù):7401
日期:2018-12 瀏覽次數(shù):4471
日期:2018-07 瀏覽次數(shù):5001
日期:2018-12 瀏覽次數(shù):4304
日期:2018-09 瀏覽次數(shù):5643
日期:2018-12 瀏覽次數(shù):10051
日期:2018-11 瀏覽次數(shù):4945
日期:2018-07 瀏覽次數(shù):4714
日期:2018-05 瀏覽次數(shù):4985
日期:2018-12 瀏覽次數(shù):4445
日期:2018-10 瀏覽次數(shù):5268
日期:2018-12 瀏覽次數(shù):6339
日期:2018-11 瀏覽次數(shù):4593
日期:2018-08 瀏覽次數(shù):4720
日期:2018-11 瀏覽次數(shù):12798
日期:2018-09 瀏覽次數(shù):5721
日期:2018-12 瀏覽次數(shù):4964
日期:2018-10 瀏覽次數(shù):4311
日期:2018-11 瀏覽次數(shù):4659
日期:2018-12 瀏覽次數(shù):6185
日期:2018-06 瀏覽次數(shù):4131
日期:2018-08 瀏覽次數(shù):5576
日期:2018-10 瀏覽次數(shù):4582
日期:2018-12 瀏覽次數(shù):4666
日期:2018-07 瀏覽次數(shù):4494
日期:2018-12 瀏覽次數(shù):4640
日期:2018-06 瀏覽次數(shù):4515
日期:2018-11 瀏覽次數(shù):4499
日期:2018-12 瀏覽次數(shù):4385
日期:2018-12 瀏覽次數(shù):5395
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.