-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Fix NavigationBar indicator overlay color #164484
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 NavigationBar indicator overlay color #164484
Conversation
d0de54c
to
4a674ae
Compare
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
4a674ae
to
3955195
Compare
Golden file changes are available for triage from new commit, Click here to view. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
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! (To trigger Google testing)
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 👍 . The Google failures were all expected.
child: Container( | ||
child: Ink( |
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.
Simple fix 👍
There is a bug caused by this change, selected nav will not change if switch nav by code instead of clicking. |
@bggRGjQaUbCoE Can you file an issue to illustrate this problem? |
@bleroux Thanks for your response, here i created an issue, #169249 |
Probably this causes yet another bug. When MaterialApp's themeData is set to use splashFactory: NoSplash.splashFactory, the indicator does not update correctly. Insted of following the selection, it lacks one step behind (e.g. requires two taps on the same target to get the indicator shown up). Code to reproduce with Flutter 3.34. Seems to affect at least Android platform.
|
This reverts commit c6c5186.
This reverts commit c6c5186.
## Description This PR reverts the change from [Fix NavigationBar indicator overlay color](#164484) as it leads to several regressions. The change was very small: replacing a Container (which obscured the overlay) with an Ink. Unfortunately this leads to some rendering issues which seem related to the Ink painting not being fully in sync with the animation logic implemented by `NavigationIndicator`. I investigated this but did not find an obvious solution. So I would prefer to revert #164484 as the issue it fixed has less impact than the regression. cc @justinmc for review and also in case you have some clue about why an Ink would cause such problems compared to a Container. ## Related Issue Fixes [[Flutter 3.32.0] Active NavigationBar item not selected when switching items programmatically](#169249) Fixes [NavigationDrawer active indicator offset with SvgPicture](#169436) Fixes #164484 (comment) Reopens #163871
…lutter#169497) ## Description This PR reverts the change from [Fix NavigationBar indicator overlay color](flutter#164484) as it leads to several regressions. The change was very small: replacing a Container (which obscured the overlay) with an Ink. Unfortunately this leads to some rendering issues which seem related to the Ink painting not being fully in sync with the animation logic implemented by `NavigationIndicator`. I investigated this but did not find an obvious solution. So I would prefer to revert flutter#164484 as the issue it fixed has less impact than the regression. cc @justinmc for review and also in case you have some clue about why an Ink would cause such problems compared to a Container. ## Related Issue Fixes [[Flutter 3.32.0] Active NavigationBar item not selected when switching items programmatically](flutter#169249) Fixes [NavigationDrawer active indicator offset with SvgPicture](flutter#169436) Fixes flutter#164484 (comment) Reopens flutter#163871
…" (#170052) This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request) Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request. ### Issue Link: What is the link to the issue this cherry-pick is addressing? #169249 #169436 ### Changelog Description: Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples NavigationBar active indicator animation gets stucked. ### Impact Description: What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch) Visual glitch visible by users. In several scenarios, the active indicator for NavigationBar and NavigationDrawer is not properly painted (animation stucked half way or active color not reflecting the current state). ### Workaround: Is there a workaround for this issue? No ### Risk: What is the risk level of this cherry-pick? - [ x ] Low ### Test Coverage: Are you confident that your fix is well-tested by automated tests? - [ x ] Yes ### Validation Steps: What are the steps to validate that this fix works? Run the code sample from #169249. This fix is a revert to a PR which landed in the current stable.
Description
This PR fixes NavigationBar lacking visual feedback on the active destination indicator.
Before:
The navigation indicator does not change color when hovered or focused:
NavigationBarIndicatorOverlayBefore.mp4
After:
The navigation indicator color changes (slightly darker):
NavigationBarIndicatorOverlayAfter.mp4
Related Issue
Fixes NavigationBar lacks visual feedback when focused or hovered
Tests