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

[Bug] Fixed a bug when passing icon as a widget to TabItem #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

issaloubani
Copy link

Adding a widget as an icon to TabItem as follows (any type of widget will suffice):

TabItem<Widget>(icon: SvgPicture.asset(Assets.iconsConversation), title: "Home"),

will cause an exception even when specifying the icon type to Widget and not IconData. The bug is caused by the they following line in build_icon.dart :

Widget icon = Icon(
      item.icon,
      size: iconSize,
      color: iconColor,
    );

since the item.icon type will be considered an IconData even if specified as widget, this is fixed by adding the following check:

Widget icon = (item.icon is Widget) ? item.icon : Icon(
      item.icon,
      size: iconSize,
      color: iconColor,
    );

@a-wallen
Copy link

@issaloubani I was just about to fix this. Thanks! I'll be cloning your fork locally 🤣

@issaloubani
Copy link
Author

@a-wallen Don't mention it 👍 . Happy to help.

@TrueJu
Copy link

TrueJu commented Apr 25, 2024

When will this be merged with master?

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

Successfully merging this pull request may close these issues.

None yet

3 participants