facebook twitter hatena line email

Flutter/インストール

提供: 初心者エンジニアの簡易メモ
2019年5月23日 (木) 10:36時点におけるAdmin (トーク | 投稿記録)による版 (gitが使えればこちらでもDL&インストールできる)

移動: 案内検索

ダウンロード

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.5.4-hotfix.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7a4c33425d (3 weeks ago) • 2019-04-29 11:05:24 -0700
Engine • revision 52c7a1e849
Tools • Dart 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

パス登録後は

$ flutter --version

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

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

flutter公式ドキュメント

https://flutter.dev/docs