Repository navigation
[material_ui] Mirror the GappedSliderTrackShape secondary track correctly in RTL - #13226
Merged
auto-submit[bot] merged 1 commit intoOct 29, 2026
Merged
Conversation
…ctly in RTL In right-to-left layouts the secondary track was drawn from `secondaryOffset.dx - trackGap` to the thumb center, so it filled the gap next to the thumb, and its corners were not mirrored: the far end had the small inside corners and the end by the thumb was fully rounded. Draw it from `secondaryOffset.dx` to one track gap before the thumb, with the corner radii mirrored from the left-to-right case. Fixes flutter/flutter#194279
SalehTZ
marked this pull request as ready for review
October 13, 2026 07:41
Contributor
There was a problem hiding this comment.
Code Review
This pull request modifies GappedSliderTrackShape in slider_parts.dart to adjust the drawing coordinates and corner radii of the secondary track in right-to-left (RTL) layouts. It also adds a pending changelog entry and updates slider_test.dart to include test coverage for the secondary track in both LTR and RTL configurations. There are no review comments, so I have no feedback to provide.
Piinks
self-requested a review
October 20, 2026 21:22
Piinks
approved these changes
Oct 28, 2026
Piinks
left a comment
Contributor
There was a problem hiding this comment.
LGTM! Thank you for this fix!
Rheoz
pushed a commit
to Rheoz/flutter
that referenced
this pull request
Oct 29, 2026
flutter/packages@13d38e0...0b72e92 2026-10-29 [email protected] [material_ui] Mirror the GappedSliderTrackShape secondary track correctly in RTL (flutter/packages#13226) 2026-10-29 [email protected] [pigeon] update jni dependency to ^1.1.1 and remove workaround proguard rules (flutter/packages#13464) 2026-10-28 [email protected] [cupertino_ui] Document translucent default background of CupertinoSlidingSegmentedControl (flutter/packages#13178) 2026-10-28 [email protected] [flutter_svg] Throw on non-2xx responses in SvgNetworkLoader (flutter/packages#13403) 2026-10-28 [email protected] [tool] Fix package matching logic for `--package-tags` filter (flutter/packages#13472) 2026-10-28 [email protected] Roll Flutter from d4c8577 to 0c2473c (21 revisions) (flutter/packages#13470) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In RTL,
GappedSliderTrackShapedrew the secondary track fromsecondaryOffset.dx - trackGaptothumbCenter.dx. That filled the gap next to the thumb, which the main track segments and the LTR secondary track keep empty. The corner radii were also copied from the LTR case instead of being mirrored, so the far end had the small inside corners and the end by the thumb was fully rounded.This PR draws the RTL secondary track from
secondaryOffset.dxtothumbCenter.dx - trackGap, with the fully rounded corners on the far end and the small inside corners next to the thumb. That is the mirror image of the LTR case. The existing visibility check just above already usedthumbCenter.dx - trackGap, so it matches the new geometry.Before and after, LTR on top and RTL below, with
Slider(year2023: false, secondaryTrackValue: ...)andtrackHeight: 24:Screenshots demonstration
⬅ RTL
⬅ RTL
I extended the existing
Default Slider when year2023 is falsetest. It now also asserts the exact LTR secondary track, and has a new RTL block with the mirrored inactive, active and secondary tracks, including corner radii. The RTL block fails without the fix.Fixes flutter/flutter#194279
Pre-Review Checklist
[shared_preferences]///).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.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2