How To Add Icon Button In Flutter Code Example


Example: 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 }

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android SDK Location Should Not Contain Whitespace, As This Cause Problems With NDK Tools