facebook twitter hatena line email

Flutter/インストール

提供: 初心者エンジニアの簡易メモ
2019年11月13日 (水) 18:22時点におけるAdmin (トーク | 投稿記録)による版 (バージョンアップ)

移動: 案内検索

ダウンロード

https://flutter.dev/docs/get-started/install/macos

設置

適当な場所(/d/src/)に設置して解凍

cd /d/src/
mv ~/Downloads/flutter_macos_v1.2.1-stable.zip ./
unzip flutter_macos_v1.2.1-stable.zip

パス追加

$ vi ~/.bash_profile
export PATH="$PATH:/d/src/flutter/bin"
$ source ~/.bash_profile

確認

flutter doctor
[✓] Flutter (Channel stable, v1.2.1, on Mac OS X 10.13.6 17G3025, locale ja-JP)
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    ✗ Android license status unknown.
[!] iOS toolchain - develop for iOS devices (Xcode 10.0)
    ✗ libimobiledevice and ideviceinstaller are not installed. To install with Brew, run:
        brew update
        brew install --HEAD usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    ✗ ios-deploy not installed. To install:
        brew install ios-deploy
[✓] Android Studio (version 3.2)
[✓] Connected device (1 available)

Android license status unknown.が出た場合

flutter doctor --android-licenses

シンプルプロジェクトを作成

flutter create my_app
cd my_app
flutter run

右下の+ボタンで数値がカウントアップしていくサンプルが立ち上がる

ホットリロード

flutter run

を実行した後、コマンドが待機状態になる、コード更新してコマンド側で"r"を押す。"R"だと再構築リロードされる

gitが使えればこちらでもDL&インストールできる

$ cd /d/src/
$ git clone -b master https://github.com/flutter/flutter.git
$ ./flutter/bin/flutter --version
Flutter 1.10.16 • channel dev • https://github.com/flutter/flutter.git
Framework • revision 798e4272a2 (5 days ago) • 2019-11-06 21:04:17 -0500
Engine • revision 34a40cfbfd
Tools • Dart 2.7.0

パス登録、もしくはエイリアスとか

$ vi ~/.bash_profile
alias flutter='/d/src/flutter/bin/flutter'
source ~/.bash_profile

パス登録後は

$ flutter --version

バージョンアップ

flutter upgrade

一旦クリア

flutter clear

flutterで作ったサンプルアプリ紹介

https://www.youtube.com/watch?time_continue=82&v=5IrPi2Eo-xM

flutter公式ドキュメント

https://flutter.dev/docs