Repository navigation
Add keyboard support for RangeSlider - #181525
xxxOVALxxx wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds keyboard support to the RangeSlider widget, a feature that was previously missing. The changes include handling keyboard inputs to adjust the slider's start and end thumbs, with support for both LTR and RTL text directions. New tests have been added to verify this functionality. My review focuses on improving code structure and readability. I've suggested a refactoring to reduce code duplication in the widget's build method.
3d086e6 to
7f79f06
Compare
| final Map<ShortcutActivator, Intent> shortcutMap = switch (MediaQuery.navigationModeOf( | ||
| context, | ||
| )) { | ||
| NavigationMode.directional => _directionalNavShortcutMap, |
There was a problem hiding this comment.
reading at the doc and the original issue #54877, the arrow key should be completely ignored in this mode.
There was a problem hiding this comment.
Am I correct in understanding that when using the D-pad, Thumbs control should be ignored? What should happen then when using directional mode?
There was a problem hiding this comment.
I'm not very familiar with d-pad controls on TVs. Maybe we need this behavior? But how do we change the value then?
Screen.Recording.2026-01-31.at.19.45.16.mov
I suggest that in direction mode, the entire RangeSlider should be the focusable element, and to change values, you need to press Enter to switch to “Edit” mode.
There was a problem hiding this comment.
from my experience, if using d pad, a user will need to first hit confirm which will lock them in the control to adjust the value by d pad. It sounds like a non trivial work though. Consider leave a todo here and fix that in a separate pr
There was a problem hiding this comment.
Added the TODO. Thanks for the feedback!
There was a problem hiding this comment.
can you also file an issue and link it here?
There was a problem hiding this comment.
can you link the issue in the todo as well?
chunhtai
left a comment
There was a problem hiding this comment.
LGTM, just one minor comment
| final Map<ShortcutActivator, Intent> shortcutMap = switch (MediaQuery.navigationModeOf( | ||
| context, | ||
| )) { | ||
| NavigationMode.directional => _directionalNavShortcutMap, |
There was a problem hiding this comment.
can you link the issue in the todo as well?
|
autosubmit label was removed for flutter/flutter/181525, because - The status or check suite Mac_arm64 tool_tests_commands has failed. Please fix the issues identified (or deflake) before re-applying this label.
|
|
Thanks for your contribution! This PR has reached completion, however we're not able to merge this PR for the moment due to the Material/Cupertino code freeze (#184093). As soon as the decoupling is complete, we will post a way to port this PR to the new packages to land. In the meantime, I'll convert this PR to a draft and apply a label so that we can quickly find it when the freeze is lifted. |
ce2b9f8 to
bf81252
Compare
|
Also I've rebased this PR because the check failure appear to be the result of the recent CICD hiccups. |
dkwingsmt
left a comment
There was a problem hiding this comment.
Approving to trigger Google tests
|
Hello! Just checking on the timeline here — this is the likely root cause of a GAR bug on our side (b/496500215) and the earlier code freeze is now thawed. Can this be reviewed/submitted? |
|
I've marked this PR as not ready to port to flutter/packages yet. |
|
This PR is ready to port to flutter/packages! 🥳 |
This PR adds keyboard support for RangeSlider and new tests. I took this implementation from Slider
This PR fixes the following issue: #179638
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.