酢ろぐ!

カレーが嫌いなスマートフォンアプリプログラマのブログ。

Flutterでプロジェクトを作成する

前回、インストールする方法を書きました。本記事ではFlutterでプロジェクトを作成します。

空プロジェクトを作成する

flutter create -i swift --org jp.ch3cooh ~/Desktop/hoge

$ flutter create -i swift --org jp.ch3cooh ~/Desktop/hoge 
Creating project ....
  ios/Runner.xcworkspace/contents.xcworkspacedata (created)
...省略...
Running "flutter packages get" in hoge...            12.3s

[✓] Flutter is fully installed. (Channel beta, v0.1.5, on Mac OS X 10.13.3 17D47, locale ja-JP)
[✓] Android toolchain - develop for Android devices is fully installed. (Android SDK 27.0.1)
[✓] iOS toolchain - develop for iOS devices is fully installed. (Xcode 9.2)
[✓] Android Studio is fully installed. (version 3.0)
[✓] VS Code is fully installed. (version 1.20.1)
[✓] Connected devices is fully installed. (3 available)

All done! In order to run your application, type:

  $ cd .
  $ flutter run

Your main program file is lib/main.dart in the . directory.

アプリを実行する

iOSシミュレータを起動します。

open -a Simulator

さきほど作成したflutterプロジェクトを実行します。

flutter run -d 2DAD3557-05B3-499C-862A-FC7B61BCB3A6

f:id:ch3cooh393:20180303004851p:plain

アプリのデバッグ実行中にrキーを入力するとホットリロードされる。Rキーを入力するとフルリロードされます。