How to resizing an Icon / Icon Button in Flutter? How to resizing an Icon / Icon Button in Flutter? android android

How to resizing an Icon / Icon Button in Flutter?


You can use size property for Icon.

Icon(  Icons.radio_button_checked,  size: 12,),

And for IconButton you can use

Transform.scale(  scale: 0.5,  child: IconButton(    onPressed: (){},    icon: new Image.asset("images/IG.png"),  ),),


For first question u can use sized box to contain IconButton and if it is breaking when adding more either use scroll or reduce width and height of sized box with respect to child.

new SizedBox(   height: /*calculate from width and no:of child*/,   width: /*calculate from width and no:of child*/,   child: new IconButton(      padding: new EdgeInsets.all(0.0),      icon: new Image.asset("images/IG.png"),      onPressed: null,   ))

for second question u can use AssetImage('icons/heart.png', package: 'my_icons')you can refer Doc


Below code set width & height for the IconButton and make it to the center of your Container.

 Container(            height: 18.0,            width: 18.0,            color: Colors.yellow,            child: new IconButton(              padding: new EdgeInsets.all(0.0),              color: Colors.red,              icon: new Icon(Icons.clear, size: 18.0),              onPressed: null,            )        )

Output:

enter image description here