Answers for "how to make a icon button and on click go back flutter"

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

Code answers related to "how to make a icon button and on click go back flutter"

Browse Popular Code Answers by Language