Create a gist now

Instantly share code, notes, and snippets.

Embed
Clean Dart 2 Widgets
// Before Dart 2
Widget build(BuildContext context) {
return new Container(
height: 56.0,
padding: const EdgeInsets.symmetric(horizontal: 8.0),
decoration: new BoxDecoration(color: Colors.blue[500]),
child: new Row(
...
),
);
}
// After Dart 2
Widget build(BuildContext context) =>
Container(
height: 56.0,
padding: EdgeInsets.symmetric(horizontal: 8.0),
decoration: BoxDecoration(color: Colors.blue[500]),
child: Row(
...
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment