How to resize (height and width) of an IconButton in Flutter

You can replace IconButton with InkWell:

InkWell(
    child: Icon(Icons.clear, size: 18.0, color: themeData.primaryColor),
    onTap: onDelete,
),

You can force it to size itself with the SizedBox.

new SizedBox(
   height: 18.0,
   width: 18.0,
   child: new IconButton(
      padding: new EdgeInsets.all(0.0),
      color: themeData.primaryColor,
      icon: new Icon(Icons.clear, size: 18.0),
      onPressed: onDelete,
   )
)

There is a newer way than the accepted answer. It looks like this:

IconButton(
  iconSize: 18.0,
  icon: new Icon(Icons.clear)

So use iconSize attribute and get rid of the SizedBox.

I noticed the old accepted solution had a bad drawing effect when pressing the button.

Tags:

Flutter