Bruno Leroux b5aef9c366
Fix NavigatorBar lacks visual feedback (#175182)
## Description

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

This is a reland of https://github.com/flutter/flutter/pull/164484 which
was reverted in https://github.com/flutter/flutter/pull/169497.
After investigation, I narrowed down the regression introduced in
https://github.com/flutter/flutter/pull/164484 to the usage of a
RepaintBoundary.
I added one test to verify that the regression which led to the revert
of https://github.com/flutter/flutter/pull/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](https://github.com/flutter/flutter/issues/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
https://github.com/flutter/flutter/pull/164484). This new test is a
golden test.
2025-10-06 16:39:19 +00:00
..

Flutter

Flutter is a new way to build high-performance, cross-platform mobile, web, and desktop apps. Flutter is optimized for today's — and tomorrow's — mobile and desktop devices. We are focused on low-latency input and high frame rates on all platforms.

See the getting started guide for information about using Flutter.