Last active
December 20, 2018 13:52
-
-
Save fabiomsr/f01d99feaadc83922b13cc21e24d0f2f to your computer and use it in GitHub Desktop.
Contact detail item
This file contains 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
class _ContactCategoryItem extends StatelessWidget { | |
final IconData icon; | |
final List<String> lines; | |
_ContactCategoryItem({ Key key, @required this.icon, @required this.lines }) | |
: super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Padding( | |
padding: const EdgeInsets.symmetric(vertical: 16.0), | |
child: Row( | |
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
children: _buildRow(context) | |
) | |
); | |
} | |
List<Widget> _buildRow(BuildContext context) { | |
final ThemeData themeData = Theme.of(context); | |
final List<Widget> firstColumn = lines.map((line) => Text(line)).toList(); | |
return <Widget> [ | |
Flexible( | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: firstColumn | |
) | |
), | |
SizedBox( | |
width: 72.0, | |
child: IconButton( | |
icon: Icon(icon), | |
color: themeData.primaryColor, | |
onPressed: () => {} | |
) | |
) | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment