Reputation: 95
I am new to coding and I am not sure how to put the text in a TextButton.icon under the actual icon. Please can you help? Here is the code:
TextButton.icon(
onPressed: () => {},
icon: Icon(
Icons.add,
color: Colors.white,
size: 50,
),
label: Text(
'Label',
style: TextStyle(
color: Colors.white,
),
)),
Upvotes: 3
Views: 2725
Reputation: 151
You can read here that it will always be in row, but you can wrap an Icon and a Textbutton in a column.
Column(
children: [
Icon(
Icons.add_outlined,
),
TextButton(
child: Text("Label"),
onPressed: () => {},
),
]
)
Upvotes: 1
Reputation: 7660
You can use Column
widget for icon
like this:
TextButton.icon(
onPressed: () => {},
icon: Column(
children: [
Icon(
Icons.add,
color: Colors.red,
size: 50,
),
Text(
'Label',
style: TextStyle(
color: Colors.red,
),
),
],
),
label: Text(
'', //'Label',
style: TextStyle(
color: Colors.red,
),
),
),
Upvotes: 7