Repository navigation
Commit 499f859
authored
[material_ui] Repaint NavigationIndicator when the selection changes without pointer input (flutter#13010)
Port of flutter#187802 to `material_ui`, following the process in flutter#188444. The original PR was approved by dkwingsmt and QuncCccccc but couldn't land because of the Material/Cupertino code freeze.
`NavigationIndicator` draws its indicator with an `Ink`, which paints on the nearest ancestor `Material` rather than locally. When the indicator animates without an accompanying pointer interaction — for example when `selectedIndex` is changed programmatically — nothing tells that `Material` to repaint, so it keeps showing the indicator's previous frame. The fix calls `Material.of(context).markNeedsPaint()` on each animation tick.
The regression test pumps a `NavigationDrawer`, changes `selectedIndex` from outside without any pointer events, and verifies the indicator repaints. I checked it fails with the one-line fix removed and passes with it, in its new location under `packages/material_ui/test/`.
The two original commits were cherry-picked without merge commits, as the porting guide describes; rename detection placed them at `lib/src/navigation_bar.dart` and `test/navigation_drawer_test.dart` with no conflicts. The only new commit adds the pending changelog entry (`version: patch`).
Fixes flutter#180359
## Pre-Review Checklist
I used AI tooling while working on this, and reviewed and tested all of it myself.
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.1 parent 83da6fb commit 499f859
3 files changed
Lines changed: 64 additions & 0 deletions
File tree
- packages/material_ui
- lib/src
- pending_changelogs
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
867 | 867 | | |
868 | 868 | | |
869 | 869 | | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
870 | 878 | | |
871 | 879 | | |
872 | 880 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
594 | 647 | | |
595 | 648 | | |
596 | 649 | | |
| |||
0 commit comments