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

Fix issue where Icon doesn't change color when selectedColor state change #31

Closed
wants to merge 2 commits into from

Conversation

jonathanMNg
Copy link

Fixed AnimatedBarOption where changing selectedColor state only change the textColor but doesn't change the Icon color.

Current Actual Result:
image
Expected Result:
image

@@ -215,6 +215,7 @@ class AnimatedNavigationTiles extends StatelessWidget {
padding: items.badgePadding,
child: IconWidget(
item: items,
color: items.selectedColor,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary color parameter: The color parameter seems redundant. The existing item property already provides the necessary color information.

@@ -412,7 +415,7 @@ class _IconWidgetState extends State<IconWidget>

animationColor = ColorTween(
begin: widget.item.backgroundColor ?? widget.item.unSelectedColor,
end: widget.item.selectedColor,
end: widget.color,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replacing item.selectedColor with color might lead to unexpected behavior if the color parameter is not used correctly or consistently. It's unclear why this change was made without a clear explanation.

Copy link
Owner

@MarsadMaqsood MarsadMaqsood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Jonathan M Nguyen,

Thanks for the PR.

I'm having trouble understanding the purpose of the added color parameter and the associated changes. It seems to duplicate functionality already provided by item.selectedColor.

Could you please clarify the reasoning behind these changes? Without a clear explanation, it's difficult to assess the potential impact on the component's behavior.

Additionally, I recommend removing the unnecessary color parameter and reverting to using item.selectedColor to maintain code simplicity and consistency.

Please let me know if you have any questions.

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

2 participants