Home > Mobile >  How can I adjust flutter icon button (or image button) to get larger?
How can I adjust flutter icon button (or image button) to get larger?

Time:11-06

leading: Padding(
        padding: EdgeInsets.only(left: 20),
        child: IconButton(
          onPressed: () => print('Menu Tapped'),
          icon: Image.asset(
            'assets/images/vecteezy_triangle_1200693.png',
            fit: BoxFit.fitWidth,
          ),
        ),
      ),

I try adding height: and width: to the Image.asset and iconsize: to IconButton but it does't work

Does it have something to do with edgeInsets?

PS* I'm quite new here, I'm follow YouTube to write a financial management app

CodePudding user response:

Since you are providing this widget to "leading", I'm guessing this is for an AppBar. The size of the icon cannot exceed the size of your appbar. You need to increase the size of your appbar to be able to increase the size of your icon. If this doesn't work, provide your code containing the AppBar widget so I can test it out for you.

CodePudding user response:

if your code is about Appbar you need to increase the icon's space in the Appbar by using toolbarHeight: and leadingWidth: in the Appbar widget. I hope this work for you.

  • Related