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

Was this helpful?

  1. widget

scaffold

Previousstateful componentNextscaffold x drawer

Last updated 5 years ago

Was this helpful?

// following code is checked in 2016/01/13
import 'package:flutter/material.dart';

void main() {
  MyBody body = new MyBody();
  //Widget statusBar = new Text("--status bar--",style:new TextStyle(fontSize:10.0));
  Widget toolBar = new ToolBar(
    center: new Text("center"),
    left: new Text("left"),
    right: [
      new Text("right1"),
      new Text("right2"),
      new Text("right3")],
    backgroundColor: new Color.fromARGB(0xff, 0xff, 0xaa, 0xaa)
  );
  // .package/material_design_icons/lib/icons/content/drawable-hdpi/ic_add_black_24dp.png
  Widget floatingActionButton = new FloatingActionButton(
    child: new Icon(
      icon: 'content/add',
      size: IconSize.s24
    ),
    backgroundColor: new Color.fromARGB(0xff, 0xaa, 0xff, 0xaa),
    onPressed: (){
      print("pressed");
      body.text += "\n hello";
      body.update();
    }
  );
  Scaffold s = new Scaffold(
    toolBar:toolBar,
    body:body,
    floatingActionButton:floatingActionButton//,
    //bottomSheet:statusBar
  );

  // 2015/10/26 if use IconButton's icon option, need MatrialApp?
  runApp(new MaterialApp(
      title: "Scaffold",
      routes: <String, RouteBuilder>{
        '/': (RouteArguments args) {
          return s;
        },
      }));
  //runApp(s);
}

class MyBody extends StatefulComponent {
  String text = "--hello--";
  State<MyBody> current = null;
  State createState() {
    current = new MyBodyState();
    return current;
  }
  update() {
    if(current != null) {
      current.setState((){});
    }
  }
}

class MyBodyState extends State<MyBody> {
  Widget build(BuildContext context) {
    return new Material(
      child: new Center(
        child: new Text(config.text)
      )
    );
  }
}
# flutter.yaml
material-design-icons:
  - name: action/account_balance
  - name: action/assessment
  - name: action/help
  - name: action/search
  - name: action/settings
  - name: action/thumb_down
  - name: action/thumb_up
  - name: content/add
  - name: navigation/arrow_back
  - name: navigation/menu
  - name: navigation/more_vert
https://github.com/kyorohiro/hello_skyengine/tree/master/widget_scaffold