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

leftIconConfig OnClick error and rightIconConfig Widget Error #432

Closed
AndreLuizNogueira opened this issue Dec 23, 2024 · 2 comments
Closed
Assignees
Labels
bug Something isn't working priority:1 Bug/Enhancement with highest priority.

Comments

@AndreLuizNogueira
Copy link

I Just Tested Version 1.3.0 and found 2 possible errors.

leftIconConfig: IconDataConfig(
icon: (context) => Icon(Icons.arrow_back_ios, color: Colors.white),
),
rightIconConfig: IconDataConfig(
icon: (context) =>
Icon(Icons.arrow_forward_ios, color: Colors.white),
),

1 - leftIconConfig: When you set this property, onclick is disabled;

2 - rightIconConfig. This property is not changing the icon. It is always using the default icon.

I went back to 1.2.0 and leftIcon and rightIcon worked fine;

leftIcon: const Icon(Icons.arrow_back_ios, color: Colors.white),
rightIcon: const Icon(Icons.arrow_forward_ios, color: Colors.white),

@shubham-jitiya-simform
Copy link
Contributor

Hi @AndreLuizNogueira
Thanks for reporting this issue.
1 - leftIconConfig: When you set this property, onclick is disabled; - This is the expected behaviour you can check here in the documentation.
2 - rightIconConfig. This property is not changing the icon. It is always using the default icon. - This will be fixed in PR #437.

Example

Refer this snippet to provide change default icon

headerStyle: HeaderStyle(
     leftIconConfig: IconDataConfig(
       icon: (_) => InkWell(
         onTap: () => debugPrint('On left icon tapped'),
         child: Padding(
           padding: EdgeInsets.all(16),
           child: Icon(Icons.arrow_left, color: Colors.red),
         ),
       ),
     ),
     rightIconConfig: IconDataConfig(
       icon: (_) => InkWell(
         onTap: () => debugPrint('On right icon tapped'),
         child: Padding(
           padding: EdgeInsets.all(16),
           child: Icon(Icons.arrow_right, color: Colors.red),
         ),
       ),
     ),
   )

Preview

Screenshot 2024-12-30 at 11 56 20 AM

@AndreLuizNogueira
Copy link
Author

AndreLuizNogueira commented Dec 30, 2024

Hi @AndreLuizNogueira
Thanks for reporting this issue.
1 - leftIconConfig: When you set this property, onclick is disabled; - This is the expected behaviour you can check here in the documentation.
2 - rightIconConfig. This property is not changing the icon. It is always using the default icon. - This will be fixed in PR #437.

Example

Refer this snippet to change default icon

headerStyle: HeaderStyle(
     leftIconConfig: IconDataConfig(
       icon: (_) => InkWell(
         onTap: () => debugPrint('On left icon tapped'),
         child: Padding(
           padding: EdgeInsets.all(16),
           child: Icon(Icons.arrow_left, color: Colors.red),
         ),
       ),
     ),
     rightIconConfig: IconDataConfig(
       icon: (_) => InkWell(
         onTap: () => debugPrint('On right icon tapped'),
         child: Padding(
           padding: EdgeInsets.all(16),
           child: Icon(Icons.arrow_right, color: Colors.red),
         ),
       ),
     ),
   )

Preview

Screenshot 2024-12-30 at 11 56 20 AM

Hello. Sorry about the first one, I just migrated from version 1.2.0 without testing, where all I had was the widget customization. I believe this deserves a breaking change notice, because I was using version 1.3.0 for months without ontap working, I only noticed the problem recently because I migrated to material 3 and had to check everywhere.

PRBaraiya added a commit that referenced this issue Dec 30, 2024
…n_config

fix: Fixes issue #432: 🐛 Fixes right icon always shows default icon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:1 Bug/Enhancement with highest priority.
Projects
None yet
Development

No branches or pull requests

2 participants