-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Added option to disable [NavigationRailDestination]s #127113
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
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
This is a reasonable idea for a feature however changing the opacity of the inkwell's child isn't consistent with the way the disabled state is handled in other widgets, it can't be overridden and there's no theme entry. It shouldn't be possible to tab into a disabled destination or to control it with the keyboard. And PRs need tests. |
|
Hello @HansMuller.
Agreed, I stated that in the issue I opened, I just wanted to present the problem, I will see if I can read about it and implement it tonight.
What do you mean by that?
That is handled by the pull request since the ink well is the only thing that makes it targetable.
Sure, I will write one, now just to be sure, it has to just check if the disabled flag is making the InkWell non clickable? |
|
@HansMuller I added the tests and changed the custom opacity code to do the same thing the ButtonStyle does, which is use the onSurface color with 0.38 opacity |
HansMuller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…tination widget) (flutter#132361) This PR adds a new option in the NavigationDestination api (the destination widget for the NavigationBar) allowing it to be disabled. As the issue states this PR is the NavigationBar's version of these two PRs (flutter#132349 and flutter#127113) * flutter#132359
It adds the optional property [disabled] to the public class [NavigationRailDestinations], this is the only public change visible in the flutter API.
As for internal changes the [_RailDestination] widget now takes this new property into consideration for rendering the widget. (It applies an opacity and removes the function from the button's InkWell when disabled)
Pre-launch Checklist
///).