Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using an image from an asset, control size of said image #20

Closed
BarryCarlyon opened this issue Apr 21, 2022 · 4 comments
Closed

When using an image from an asset, control size of said image #20

BarryCarlyon opened this issue Apr 21, 2022 · 4 comments

Comments

@BarryCarlyon
Copy link

BarryCarlyon commented Apr 21, 2022

BilalShahid13#138 (comment)

Since there is actually some maintenance going on.

Do you think you can solve this one?

So for example (under style 3)

      PersistentBottomNavBarItem(
        icon: ImageIcon(
          AssetImage('assets/nav/news.png'),
          color: Colors.white,
          size: 512,
        ),
        iconSize: 30,
        title: "News",
        activeColorPrimary: Color.fromRGBO(101, 21, 24, 1),
        inactiveColorPrimary: Colors.grey,
        inactiveColorSecondary: Colors.purple,
      ),

Results in a tiny icon and regardless of size or iconSize the icon on the nav bar is pidly small and will not change size at all

basically looks like what is reported in BilalShahid13#254

@BarryCarlyon
Copy link
Author

BarryCarlyon commented Apr 21, 2022

I got a solution via

      PersistentBottomNavBarItem(
        icon: Transform.scale(
          scale: 4,
          child: Padding(
            padding: const EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 0.0),
            child: ImageIcon(
              AssetImage('assets/nav/news.png'),
              color: Colors.white,
              size: 512,
            ),
          ),
        ),
        title: "News",
        activeColorPrimary: Color.fromRGBO(101, 21, 24, 1),
        inactiveColorPrimary: Colors.grey,
        inactiveColorSecondary: Colors.purple,
      ),

But this seems like a cluster?

This fixes the image size to be correct and the adds in some forced padding to correct the icon placement

@jb3rndt
Copy link
Owner

jb3rndt commented Apr 23, 2022

I'm going to look into it

@jb3rndt
Copy link
Owner

jb3rndt commented Apr 25, 2022

Ok it should be fixed with version 4.1.10.
There was top padding for the tab label in most styles which somehow has no effect to the flutter icons, but did break the layout for the imageIcon.
Feel free to reopen the issue if I missed something

@jb3rndt jb3rndt closed this as completed Apr 25, 2022
@BarryCarlyon
Copy link
Author

Can confirm fixed! Praise be!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants