How to Remove IconButton Big Padding?

· 4 min read
How to Remove IconButton Big Padding
How to Remove IconButton Big Padding

IconButton is a Material Design widget that follows the spec that tappable objects need to be at least 48px on each side. You can click on the icon button implementation from any IDEs. So in today’s article, we will go through how to Remove IconButton Big Padding ??

How to Remove IconButton Big Padding ??

Still Use IconButton

Wrap the IconButton inside a Container that has a width.

  padding: const EdgeInsets.all(0.0),
  width: 30.0, // you can adjust the width as you need
  child: IconButton(

Use GestureDetector instead of IconButton

You can also use GestureDetector instead of IconButton

GestureDetector( onTap: () {}, child: Icon(Icons.volume_up) )

Simply pass an empty BoxConstrains to the constraints property and padding of zero.

    constraints: BoxConstraints(),

You have to pass the empty constraints because, by default, the IconButton widget assumes a minimum size of 48px.

Wrapping the IconButton in a container simply won’t work, instead, use ClipRRect and add a material Widget with an Inkwell, just make sure to give the correct widget enough border Radius

    borderRadius: BorderRadius.circular(50),
    child : Material(
        child : InkWell(
            child : Padding(
                padding : const EdgeInsets.all(5),
                child : Icon(
            onTap : () {},

Here’s a solution to get rid of any extra padding, using InkWell in place of IconButton:

Widget backButtonContainer = InkWell(
    child: Container(
      child: const Icon(
        color: Colors.white,
        size: 35.0,
    onTap: () {

Instead of removing padding around an IconButton you could simply use an Icon and wrap it with a GestureDetector or InkWell as


In case you want the ripple/Ink splash effect as the IconButton provides on click-wrap it with an InkWell


though the Ink thrown on the Icon in the second approach won’t be so accurate as for the IconButton, you may need to do some custom implementation for that.

A better solution is to use Transform.scale like this:

  scale: 0.5, // set your value here
  child: IconButton(icon: Icon(Icons.smartphone), onPressed: () {}),

You can use ListTile it gives you a default space between text and Icons that would fit your needs

         leading: Icon(Icons.add), //Here Is The Icon You Want To Use
         title: Text('GFG title',textScaleFactor: 1.5,), //Here Is The Text Also
         trailing: Icon(Icons.done),


Hope you have learned from this article!!! Keep Fluttering!!!

In this article, we have been through how to Remove IconButton Big Padding

Do not forget to drop your valuable suggestions/feedback. We would love to assist you. is our portal Platform dedicated to Flutter Technology and Flutter Developers. The portal is full of cool resources from Flutter like Flutter Widget GuideFlutter ProjectsCode libs and etc. is one of the most popular online portals dedicated to Flutter Technology and daily thousands of unique visitors come to this portal to enhance their knowledge of Flutter.

Leave a Reply