how you can remove the padding between the icon for the drawer in the appBar and the Search Icon in flutter


i make appBar and add a drawer to it and also search icon the problem there is padding between the icon for the Drawer and the search icon And I can't get rid of it

this the code

`class _HomeState extends State<Home> {

@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( titleSpacing: 0, title: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ IconButton( icon: Icon(, onPressed: () {}, ), ], ),

    backgroundColor: Color(0xffffffff),
    elevation: 1,
    toolbarHeight: 40.0,
    iconTheme: IconThemeData(color: Colors.grey),
  drawer: Drawer(
    child: ListView(
      children: <Widget>[],
  body: Container(
    height: MediaQuery.of(context).size.height,
    width: MediaQuery.of(context).size.width,
    color: Color(0xfffafafa),
    child: Text("hello"),

} }`

asked on Stack Overflow Nov 4, 2020 by Muhammed Jack

1 Answer


Wrapping your search button with this will reduce the padding.

Not sure how much of the padding you wanted to remove.

  width: 10.0,
  child: IconButton(
    icon: Icon(,
    onPressed: () {},
answered on Stack Overflow Nov 4, 2020 by Will Hlas

User contributions licensed under CC BY-SA 3.0