Skip to content

Instantly share code, notes, and snippets.

@fabiomsr
Last active December 20, 2018 13:52
Show Gist options
  • Save fabiomsr/f01d99feaadc83922b13cc21e24d0f2f to your computer and use it in GitHub Desktop.
Save fabiomsr/f01d99feaadc83922b13cc21e24d0f2f to your computer and use it in GitHub Desktop.
Contact detail item
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