Ad

How To Change Color In TextButton.icon

- 1 answer

I want to have an icon with text, so I used TextButton.icon but I can not change the color of the text or icon! Please suggest if anyone has a solution this is my code:

SizedBox(height: 8,),
        TextButton.icon(
          icon: Icon(Icons.delete),
          label: Text('delete'),

          onPressed: (){},
        ),
Ad

Answer

Try below code hope its helpful to you.
Refer TextButtonhere

TextButton.icon(
  icon: Icon(
    Icons.delete,
    color: Colors.red,//for icon color
  ),
  label: Text(
    'Delete',
    style: TextStyle(
      color: Colors.red,//for text color
    ),
  ),
  onPressed: () {},
),

Result Screen-> image

Ad
source: stackoverflow.com
Ad