diff --git a/examples/flutter_gallery/lib/demo/contacts_demo.dart b/examples/flutter_gallery/lib/demo/contacts_demo.dart index 25b64467f2..7fc285f7b6 100644 --- a/examples/flutter_gallery/lib/demo/contacts_demo.dart +++ b/examples/flutter_gallery/lib/demo/contacts_demo.dart @@ -12,18 +12,21 @@ class _ContactCategory extends StatelessWidget { @override Widget build(BuildContext context) { + final ThemeData themeData = Theme.of(context); return new Container( padding: const EdgeInsets.symmetric(vertical: 16.0), decoration: new BoxDecoration( - border: new Border(bottom: new BorderSide(color: Theme.of(context).dividerColor)) + border: new Border(bottom: new BorderSide(color: themeData.dividerColor)) ), child: new DefaultTextStyle( style: Theme.of(context).textTheme.subhead, child: new Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - new SizedBox( + new Container( + padding: const EdgeInsets.symmetric(vertical: 24.0), width: 72.0, - child: new Icon(icon, color: Theme.of(context).primaryColor) + child: new Icon(icon, color: themeData.primaryColor) ), new Flexible(child: new Column(children: children)) ] @@ -45,8 +48,9 @@ class _ContactItem extends StatelessWidget { @override Widget build(BuildContext context) { + final ThemeData themeData = Theme.of(context); List columnChildren = lines.sublist(0, lines.length - 1).map((String line) => new Text(line)).toList(); - columnChildren.add(new Text(lines.last, style: Theme.of(context).textTheme.caption)); + columnChildren.add(new Text(lines.last, style: themeData.textTheme.caption)); List rowChildren = [ new Flexible( @@ -59,7 +63,11 @@ class _ContactItem extends StatelessWidget { if (icon != null) { rowChildren.add(new SizedBox( width: 72.0, - child: new IconButton(icon: new Icon(icon), onPressed: onPressed) + child: new IconButton( + icon: new Icon(icon), + color: themeData.primaryColor, + onPressed: onPressed + ) )); } return new Padding( @@ -200,7 +208,7 @@ class ContactsDemoState extends State { ] ), new _ContactCategory( - icon: Icons.email, + icon: Icons.contact_mail, children: [ new _ContactItem( icon: Icons.email,