Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading