Flutter change the child icon color of FloatingActionButton
Flutter v17.4
This worked for me, if you just want to change to colour of icon.
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add,
color: Colors.black, //The color which you want set.
),
onPressed: () => {},
),
You can wrap in an IconTheme
child: new IconTheme(
data: new IconThemeData(
color: Colors.yellow),
child: new Icon(Icons.add),
),
or a Theme
where iconTheme
is set the way you want it
(not tested)
To change the color of child Icon, You have to set the color in the Icon() widget.
Here I am sharing the code snippet where I have set the red color.
floatingActionButton: FloatingActionButton(
tooltip: 'Increment',
child: new Icon(Icons.add, color: Colors.red,),
backgroundColor: Colors.yellow,
),