Last active
February 6, 2016 00:47
-
-
Save sethladd/0b4aff30c106196201f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp( | |
new MaterialApp( | |
title: "Flutter Demo", | |
routes: <String, RouteBuilder>{ | |
'/': (RouteArguments args) => new FlutterDemo() | |
} | |
) | |
); | |
} | |
class FlutterDemo extends StatefulComponent { | |
State createState() => new FlutterDemoState(); | |
} | |
class FlutterDemoState extends State { | |
int counter = 0; | |
void incrementCounter() { | |
setState(() => counter++); | |
} | |
Widget build(BuildContext context) { | |
return new Scaffold( | |
toolBar: new ToolBar( | |
center: new Text("Flutter Demo") | |
), | |
body: new Material( | |
child: new Center( | |
child: new Text("Button tapped $counter times.") | |
) | |
), | |
floatingActionButton: new FloatingActionButton( | |
child: new Icon( | |
icon: 'content/add' | |
), | |
onPressed: incrementCounter | |
) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment