Created
May 4, 2018 20:28
-
-
Save timsneath/054f8d800bb9c01e369dc04de9ec12f2 to your computer and use it in GitHub Desktop.
Simple example of a Widget build method without new keyword in Dart 2.
This file contains hidden or 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
Widget build(BuildContext context) => Scaffold( | |
appBar: AppBar( | |
title: Text(widget.title), | |
actions: <Widget>[ | |
IconButton( | |
icon: Icon(Icons.info), | |
onPressed: _aboutAction, | |
), | |
IconButton( | |
icon: Icon(Icons.share), | |
onPressed: _shareAction, | |
) | |
], | |
), | |
body: Center( | |
child: _body(), | |
), | |
floatingActionButton: FloatingActionButton( | |
onPressed: _refresh, | |
tooltip: 'Refresh', | |
child: Icon(Icons.refresh), | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment