blob: 6625aa4015647078ad47fe68cf957675788a4d3d [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() {
runApp(new MaterialApp(
title: 'Flutter Demo',
routes: <String, RouteBuilder>{
'/': (RouteArguments args) => new FlutterDemo()
}));
}
class FlutterDemo extends StatefulComponent {
_FlutterDemoState createState() => new _FlutterDemoState();
}
class _FlutterDemoState extends State<FlutterDemo> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
Widget build(BuildContext context) {
return new Scaffold(
toolBar: new ToolBar(center: new Text('Flutter Demo')),
body: new Center(
child: new Text(
'Button tapped $_counter time${ _counter == 1 ? '' : 's' }.')),
floatingActionButton: new FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: new Icon(icon: 'content/add')));
}
}