Commit d6a60536 authored by Hans Muller's avatar Hans Muller Committed by GitHub

Contacts icon alignment (#5719)

parent 8fed9d9e
...@@ -12,18 +12,21 @@ class _ContactCategory extends StatelessWidget { ...@@ -12,18 +12,21 @@ class _ContactCategory extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData themeData = Theme.of(context);
return new Container( return new Container(
padding: const EdgeInsets.symmetric(vertical: 16.0), padding: const EdgeInsets.symmetric(vertical: 16.0),
decoration: new BoxDecoration( 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( child: new DefaultTextStyle(
style: Theme.of(context).textTheme.subhead, style: Theme.of(context).textTheme.subhead,
child: new Row( child: new Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
new SizedBox( new Container(
padding: const EdgeInsets.symmetric(vertical: 24.0),
width: 72.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)) new Flexible(child: new Column(children: children))
] ]
...@@ -45,8 +48,9 @@ class _ContactItem extends StatelessWidget { ...@@ -45,8 +48,9 @@ class _ContactItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData themeData = Theme.of(context);
List<Widget> columnChildren = lines.sublist(0, lines.length - 1).map((String line) => new Text(line)).toList(); List<Widget> 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<Widget> rowChildren = <Widget>[ List<Widget> rowChildren = <Widget>[
new Flexible( new Flexible(
...@@ -59,7 +63,11 @@ class _ContactItem extends StatelessWidget { ...@@ -59,7 +63,11 @@ class _ContactItem extends StatelessWidget {
if (icon != null) { if (icon != null) {
rowChildren.add(new SizedBox( rowChildren.add(new SizedBox(
width: 72.0, 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( return new Padding(
...@@ -200,7 +208,7 @@ class ContactsDemoState extends State<ContactsDemo> { ...@@ -200,7 +208,7 @@ class ContactsDemoState extends State<ContactsDemo> {
] ]
), ),
new _ContactCategory( new _ContactCategory(
icon: Icons.email, icon: Icons.contact_mail,
children: <Widget>[ children: <Widget>[
new _ContactItem( new _ContactItem(
icon: Icons.email, icon: Icons.email,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment