Simplify demo template

We don't need these keys. Also, improve style in several places.

Fixes #2225
This commit is contained in:
Adam Barth
2016-02-26 13:31:30 -08:00
parent 240e499bc0
commit 11fa94cd6b
2 changed files with 26 additions and 17 deletions

View File

@@ -12,7 +12,7 @@ void main() {
}
class FlutterDemo extends StatefulComponent {
State createState() => new _FlutterDemoState();
_FlutterDemoState createState() => new _FlutterDemoState();
}
class _FlutterDemoState extends State<FlutterDemo> {
@@ -30,17 +30,14 @@ class _FlutterDemoState extends State<FlutterDemo> {
center: new Text('Flutter Demo')
),
body: new Center(
child: new Text(
'Button tapped $_counter times.',
key: const ValueKey('counter')
)
child: new Text('Button tapped $_counter time${ _counter == 1 ? '' : 's' }.')
),
floatingActionButton: new FloatingActionButton(
key: const ValueKey('fab'),
onPressed: _incrementCounter,
tooltip: 'Increment',
child: new Icon(
icon: 'content/add'
),
onPressed: _incrementCounter
)
)
);
}