Skip to content

Conversation

@bleroux
Copy link
Contributor

@bleroux bleroux commented Sep 10, 2025

Description

This PR fixes NavigationBar lacking visual feedback on the active destination indicator.

This is a reland of #164484 which was reverted in #169497.
After investigation, I narrowed down the regression introduced in #164484 to the usage of a RepaintBoundary.
I added one test to verify that the regression which led to the revert of #164484 is no more reproducible.

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

  • Updates several helper functions which are used by several tests.
  • Updates several test: adding an Ink widget changes the coordinates used in several tests because these coordinates are now relative to the Ink offset.
  • Add one test to check that active destination moves to the correct destination (that was not the case after Fix NavigationBar indicator overlay color #164484). This new test is a golden test.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Sep 10, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses an issue where the NavigationBar's active destination indicator lacked visual feedback on hover or focus. The core change involves replacing a Container widget with an Ink widget within the NavigationIndicator, which enables ink splash effects for visual feedback. Additionally, RepaintBoundary widgets, which were identified as the cause of a previous regression where the indicator failed to move, have been removed from the _NavigationBarDestinationLayout. A new regression test has been added to verify that the indicator correctly moves to the selected destination. Several existing tests across navigation_bar, navigation_drawer, and navigation_rail have been updated to reflect these changes, including adjustments to widget finders and layout calculations.

@flutter-dashboard
Copy link

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 package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #175182 at sha 36b56c4

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label Sep 10, 2025
@bleroux bleroux requested a review from justinmc September 10, 2025 19:54
Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@bleroux
Copy link
Contributor Author

bleroux commented Sep 23, 2025

@justinmc If you get a chance, thank you to have a look at the Google testing failures.
Probably the same than the previous PR, see #164484 (review) where you mentioned the failures were expected.

@dkwingsmt dkwingsmt requested a review from justinmc September 24, 2025 18:39
@bleroux
Copy link
Contributor Author

bleroux commented Oct 2, 2025

@victorsanni In case you have the bandwidth to look at the Google failures. This PR is a reland of #164484. There were some Google failures for the first PRs but they were expected as the tests were capturing the wrong behavior (no overlay/splash), so the failure here are probably the same.

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

Sorry for the delay here. The Google test failures were a few imperceptible pixel changes in a bottom nav bar that seems reasonable to changing the widget tree a little bit like this.

@justinmc justinmc added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 6, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Oct 6, 2025
Merged via the queue into flutter:master with commit b5aef9c Oct 6, 2025
78 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 6, 2025
@bleroux bleroux deleted the fix_navigator_bar_lacks_visual_feedback branch October 6, 2025 18:14
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 7, 2025
mboetger pushed a commit to mboetger/flutter that referenced this pull request Oct 7, 2025
## Description

This PR fixes NavigationBar lacking visual feedback on the active
destination indicator.

This is a reland of flutter#164484 which
was reverted in flutter#169497.
After investigation, I narrowed down the regression introduced in
flutter#164484 to the usage of a
RepaintBoundary.
I added one test to verify that the regression which led to the revert
of flutter#164484 is no more
reproducible.

### Before:

The navigation indicator does not change color when hovered or focused:


https://github.com/user-attachments/assets/a1e67dee-4a38-4711-ba90-bdcd9bed3226


### After:

The navigation indicator color changes (slightly darker):


https://github.com/user-attachments/assets/1b1cc335-2cf4-4c41-9c53-696537707c72


## Related Issue

Fixes [NavigationBar lacks visual feedback when focused or
hovered](flutter#163871)

## Tests

- Updates several helper functions which are used by several tests.
- Updates several test: adding an Ink widget changes the coordinates
used in several tests because these coordinates are now relative to the
Ink offset.
- Add one test to check that active destination moves to the correct
destination (that was not the case after
flutter#164484). This new test is a
golden test.
okorohelijah pushed a commit to okorohelijah/flutter that referenced this pull request Oct 7, 2025
## Description

This PR fixes NavigationBar lacking visual feedback on the active
destination indicator.

This is a reland of flutter#164484 which
was reverted in flutter#169497.
After investigation, I narrowed down the regression introduced in
flutter#164484 to the usage of a
RepaintBoundary.
I added one test to verify that the regression which led to the revert
of flutter#164484 is no more
reproducible.

### Before:

The navigation indicator does not change color when hovered or focused:


https://github.com/user-attachments/assets/a1e67dee-4a38-4711-ba90-bdcd9bed3226


### After:

The navigation indicator color changes (slightly darker):


https://github.com/user-attachments/assets/1b1cc335-2cf4-4c41-9c53-696537707c72


## Related Issue

Fixes [NavigationBar lacks visual feedback when focused or
hovered](flutter#163871)

## Tests

- Updates several helper functions which are used by several tests.
- Updates several test: adding an Ink widget changes the coordinates
used in several tests because these coordinates are now relative to the
Ink offset.
- Add one test to check that active destination moves to the correct
destination (that was not the case after
flutter#164484). This new test is a
golden test.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 8, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Oct 8, 2025
Roll Flutter from 908012d58baa to e11e2c11288b (39 revisions)

flutter/flutter@908012d...e11e2c1

2025-10-08 [email protected] Configure FfiNative resolver on dart:io (flutter/flutter#176621)
2025-10-08 [email protected] Marks Linux_pixel_7pro service_extensions_test to be unflaky (flutter/flutter#176700)
2025-10-08 [email protected] Keyboard Animation Fix (flutter/flutter#176418)
2025-10-08 [email protected] Feat: Add carousel view builder (flutter/flutter#172837)
2025-10-08 [email protected] Roll Skia from d10a0d877ff4 to ea7cdbc6b986 (15 revisions) (flutter/flutter#176686)
2025-10-08 [email protected] Roll Fuchsia Linux SDK from jJr3my9C6TwYWPygi... to xrIAL91ngrd-wNr9S... (flutter/flutter#176682)
2025-10-08 [email protected] Fix InputDecoration helper/error padding is not compliant (flutter/flutter#176353)
2025-10-08 [email protected] Fix PopupMenu does not update when PopupMenuTheme in Theme changes. (flutter/flutter#175513)
2025-10-07 [email protected] Roll Dart SDK to 3.10.0-290.1.beta (flutter/flutter#176629)
2025-10-07 [email protected] [ Tool ] Output `app.dtd` and `app.devTools` in machine mode (flutter/flutter#176655)
2025-10-07 [email protected] Rename UIScene integration test projects and fix Xcode compatibility (flutter/flutter#176635)
2025-10-07 [email protected] Selecting an implementation widget with the on-device inspector opens the code location for the nearest project widget (flutter/flutter#176530)
2025-10-07 [email protected] Migrate to `WidgetStateInputBorder` (flutter/flutter#176386)
2025-10-07 [email protected] Make it clear that you need to install clangd in VSCode intellisense c++ config (flutter/flutter#176609)
2025-10-07 [email protected] Bump the customer tests to pick up an update to Zulip's tests. (flutter/flutter#176463)
2025-10-07 [email protected] Roll Packages from d3ef88b to 8ca6416 (2 revisions) (flutter/flutter#176633)
2025-10-07 [email protected] Add fallback for 'scene:willConnectToSession:options' (flutter/flutter#176580)
2025-10-07 [email protected] Roll Skia from d09786dfb854 to d10a0d877ff4 (11 revisions) (flutter/flutter#176616)
2025-10-07 [email protected] [ Widget Preview ] Rework UI and theming (flutter/flutter#176581)
2025-10-07 [email protected] Handle FlutterEngine registration when embedded in Multi-Scene apps (flutter/flutter#176490)
2025-10-07 [email protected] Fix code style in Linux embedder template (flutter/flutter#176256)
2025-10-07 [email protected] Add tooling to migrate to UIScene (flutter/flutter#176427)
2025-10-06 [email protected] Bump customer tests.version to 986c4326b4e4bb4e37bc963c2cc2aaa10b943859 (flutter/flutter#176594)
2025-10-06 [email protected] Fix typo in pages.dart (flutter/flutter#176438)
2025-10-06 [email protected] Fix: Update anchorRect for overlayBuilder when anchor moves (flutter/flutter#169814)
2025-10-06 [email protected] Roll Fuchsia Linux SDK from Zm6K_3gP3VCaMy9rH... to jJr3my9C6TwYWPygi... (flutter/flutter#176591)
2025-10-06 [email protected] Fix deprecated configureStatusBarForFullscreenFlutterExperience for Android 15+ (flutter/flutter#175501)
2025-10-06 [email protected] updates docs for flutter engine footprint (flutter/flutter#176217)
2025-10-06 [email protected] [ Widget Preview ] Fix `WidgetInspectorService` override (flutter/flutter#176550)
2025-10-06 [email protected] Fix NavigatorBar lacks visual feedback (flutter/flutter#175182)
2025-10-06 [email protected] Roll Packages from e401aeb to d3ef88b (4 revisions) (flutter/flutter#176582)
2025-10-06 [email protected] Roll Dart SDK from 898380a41c90 to 6b0193498f09 (2 revisions) (flutter/flutter#176576)
2025-10-06 [email protected] Roll Skia from bc7cf194f4ee to d09786dfb854 (1 revision) (flutter/flutter#176577)
2025-10-06 [email protected] Roll vulkan-deps to a9e2ca3b (flutter/flutter#176322)
2025-10-06 [email protected] Add an AppDelegate callback for implicit FlutterEngines (flutter/flutter#176240)
2025-10-06 [email protected] Roll Skia from 45191c22b15c to bc7cf194f4ee (2 revisions) (flutter/flutter#176572)
2025-10-06 [email protected] [ Widget Preview ] Fix type error when retrieving flags from persistent preferences (flutter/flutter#176546)
2025-10-06 [email protected] Roll Skia from 1fd0ca1f2120 to 45191c22b15c (3 revisions) (flutter/flutter#176556)
2025-10-05 [email protected] Roll Dart SDK from 016a8c0045fd to 898380a41c90 (1 revision) (flutter/flutter#176549)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

...
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
## Description

This PR fixes NavigationBar lacking visual feedback on the active
destination indicator.

This is a reland of flutter#164484 which
was reverted in flutter#169497.
After investigation, I narrowed down the regression introduced in
flutter#164484 to the usage of a
RepaintBoundary.
I added one test to verify that the regression which led to the revert
of flutter#164484 is no more
reproducible.

### Before:

The navigation indicator does not change color when hovered or focused:


https://github.com/user-attachments/assets/a1e67dee-4a38-4711-ba90-bdcd9bed3226


### After:

The navigation indicator color changes (slightly darker):


https://github.com/user-attachments/assets/1b1cc335-2cf4-4c41-9c53-696537707c72


## Related Issue

Fixes [NavigationBar lacks visual feedback when focused or
hovered](flutter#163871)

## Tests

- Updates several helper functions which are used by several tests.
- Updates several test: adding an Ink widget changes the coordinates
used in several tests because these coordinates are now relative to the
Ink offset.
- Add one test to check that active destination moves to the correct
destination (that was not the case after
flutter#164484). This new test is a
golden test.
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. framework flutter/packages/flutter repository. See also f: labels. will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NavigationBar lacks visual feedback when focused using keyboard on any platform, or when touched on mobile devices

2 participants