Answers for "how to add icon in elevated button in flutter"

1

icon as button flutter

IconButton(
            icon: Icon(
              Icons.directions_transit,
            ),
            iconSize: 50,
            color: Colors.green,
            splashColor: Colors.purple,
            onPressed: () {},
          ),
Posted by: Guest on June-01-2021
0

flutter change the icon of icon button on pressed

bool selected = true;

//...

Widget build(BuildContext context) {
	return Scaffold(
    	body: Center(
          child: IconButton(
              icon: Icon( selected ? Icons.celebration : Icons.title),
              onPressed: () {
                setState(() {
                  selected = !selected;
                });
              },
          ), //IconButton
   		), //Center
    ); //Scaffold
}
Posted by: Guest on March-24-2021
0

flutter raised button with icon

FlatButton.icon(onPressed: null, icon: null, label: null);
RaisedButton.icon(onPressed: null, icon: null, label: null);
Posted by: Guest on June-01-2020

Code answers related to "how to add icon in elevated button in flutter"

Browse Popular Code Answers by Language