Memo : Flutter x Dart [2015-2016]
  • Introduction
  • hello
    • helloworld
    • build flutter
    • build as standalone android app(old)
      • draw text
      • draw image
      • set icon
    • build as standalone apk(now)
    • build as ios app
    • build as linux app
    • build as mac app
    • build mojo
    • build as chromeapp
  • rendering
    • draw_rect
    • anime_rect
    • anime_rect(use animation.dart)
    • draw_image
    • rotate_image
    • draw_image_from_assets
    • sound_test(rendering & service)
    • touch_test
    • multitouch_test
    • [@]demo::mini game(spacewar!)
    • draw_text
    • draw_path
    • draw_vertexs
    • draw_vertexs_with_image
    • [@]demo:3d anime
    • input text from ime(RenderObject)
  • widget
    • text
    • network image
    • assets image
    • raw image
    • container
    • row
    • col
    • flexible
    • navigator
    • stateful component
    • scaffold
    • scaffold x drawer
    • scrollable viewport
    • scrollable list
    • input text from ime(EditableText)
  • dart:io
    • HttpClient Post & Get
    • NetworkInterface
    • TCP Socket
    • UDP Socket
    • File Path(dart:io & service)
    • File Create & Permission
  • dart:ui
    • draw rect
    • pointer event
  • mojo for flutter
    • get and post request
    • sensor test
    • [@]demo:gravity sensor
  • 2d physics for scratch
    • collision without rotation
    • [@]democollision without friction
    • [b]
  • 2d physics for newton
  • mojo for native
    • build mojo
  • 48 hour trial
    • create iron heart
    • tiny tetris
Powered by GitBook
On this page
  • 環境の設定
  • Dart SDKをインストール
  • Android SDKのインストール
  • Flutter のインストール
  • アプリを作成する。

Was this helpful?

  1. hello

helloworld

PrevioushelloNextbuild flutter

Last updated 5 years ago

Was this helpful?

import 'package:flutter/widgets.dart';

void main() {
  Text t = new Text("Hello World");
  Center c= new Center (child: t);
  runApp(c);
}

環境の設定

2015/10/1の時点では、Flutterの開発環境としてはAtomが良い感じです。ですが、まずはメモ帳から初めてみましょう。

Dart SDKをインストール

コマンドラインから、pubコマンドとdartコマンドを使えるようにしましょう。

  • [Macの場合]

    brew tap dart-lang/dart && brew install dart --devel

Android SDKのインストール

adbコマンドが使えるようにしましょう。 TODO

Flutter のインストール

git clone https://github.com/flutter/flutter.git -b alpha

export PATH=`pwd`/flutter/bin:$PATH

pub get pub global activate flutter

アプリを作成する。

pubspec.yamlを作成する

name: hello
dependencies:
  sky: any
  flutter: any
  sky_tools: any
dependency_overrides:
  flutter:
    path: <cloneしたパス>/packages/flutter

libフォルダを作成する

./pubspec.yaml
./lib/

Pubコマンドでsky関連のライブラリをダウンロードする

"./" で、pubコマンドを入力する。

> pub get
..
..
> pub upgrade
..
..
``

mainプログラムを書く

"./lib/main.dart" を作成して以下を書く。

import 'package:flutter/widgets.dart';

void main() {
  Text t = new Text("Hello World");
  Center c= new Center (child: t);
  runApp(c);
}

アプリを起動する

"./" で、以下のコマンドを入力する。

flutter start --checked -t ./lib/main.dart

これで完了です。

公式サイトの

Getting Start with Flutter
Android SDK
https://github.com/kyorohiro/hello_skyengine/tree/master/hello