How i can make flat button color look same like scaffold color background

i have simple code right here:

LegacyFlatButton.icon(
  onPressed: () {},
  icon: Icon(Icons.edit_location),
  label: Text('Edit Location'),
  color: Colors.white,
),

I just want to remove the outline on this button, so that this button looks the same as the background color of the Scaffold.

This My image

Upvotes: 1

Views: 67

Answers (2)

Hamdam Muqimov
Hamdam Muqimov

Reputation: 389

LegacyFlatButton.icon(
  onPressed: () {},
  icon: Icon(Icons.edit_location),
  label: Text('Edit Location'),
  color: Theme.of(context).scaffoldBackgroundColor,
),

Simple

Upvotes: 0

Ravindra S. Patil
Ravindra S. Patil

Reputation: 14785

Try TextButton.icon widget try below code hope its help to you

TextButton.icon(
    onPressed: (){},
    icon: Icon(Icons.edit_location),
    label:Text('Edit Location'),
 )

Your result like -> enter image description here

Upvotes: 1

Related Questions