Skip to content

Conversation

@matheus-kirchesch
Copy link
Contributor

@matheus-kirchesch matheus-kirchesch commented May 18, 2023

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

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels May 18, 2023
@flutter-dashboard
Copy link

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.

@HansMuller
Copy link
Contributor

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.

@matheus-kirchesch
Copy link
Contributor Author

Hello @HansMuller.

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

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.

it can't be overridden and there's no theme entry

What do you mean by that?

It shouldn't be possible to tab into a disabled destination or to control it with the keyboard

That is handled by the pull request since the ink well is the only thing that makes it targetable.

And PRs need tests

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?

@matheus-kirchesch matheus-kirchesch deleted the patch-2 branch May 20, 2023 01:03
@matheus-kirchesch matheus-kirchesch restored the patch-2 branch May 20, 2023 01:03
@matheus-kirchesch
Copy link
Contributor Author

@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 HansMuller self-requested a review May 24, 2023 18:12
@github-actions github-actions bot removed the framework flutter/packages/flutter repository. See also f: labels. label May 29, 2023
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

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

LGTM

@HansMuller HansMuller merged commit f1c8723 into flutter:master May 30, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 3, 2023
@matheus-kirchesch matheus-kirchesch deleted the patch-2 branch August 10, 2023 18:58
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
auto-submit bot pushed a commit that referenced this pull request Sep 28, 2023
…tination widget) (#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 (#132349 and #127113)

* #132359
Mairramer pushed a commit to Mairramer/flutter that referenced this pull request Oct 10, 2023
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: material design flutter/packages/flutter/material repository.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants