[cupertino_ui] Add SemanticsRole.slider to CupertinoSlider - #12710
Draft
hannah-hyj wants to merge 1 commit into
Draft
[cupertino_ui] Add SemanticsRole.slider to CupertinoSlider#12710hannah-hyj wants to merge 1 commit into
hannah-hyj wants to merge 1 commit into
Conversation
Adds SemanticsRole.slider, minValue, and maxValue to CupertinoSlider semantics. Fixes flutter/flutter#184030 Related to flutter/flutter#184029
hannah-hyj
marked this pull request as draft
September 1, 2026 01:51
10 tasks
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates CupertinoSlider to include SemanticsRole.slider and the min and max bounds in its semantics configuration, passing these properties down to the underlying render object and updating the associated tests. The review feedback identifies a type mismatch where minValue and maxValue are incorrectly assigned and tested as String values instead of double values.
Comment on lines
+669
to
+670
| config.minValue = min.toString(); | ||
| config.maxValue = max.toString(); |
Contributor
There was a problem hiding this comment.
In Flutter's SemanticsConfiguration, minValue and maxValue are of type double?, not String?. Assigning a String (via toString()) will cause a compile-time type mismatch error. They should be assigned directly as double values.
Suggested change
| config.minValue = min.toString(); | |
| config.maxValue = max.toString(); | |
| config.minValue = min; | |
| config.maxValue = max; |
Comment on lines
+446
to
+447
| minValue: '0.0', | ||
| maxValue: '1.0', |
Contributor
Comment on lines
+473
to
+474
| minValue: '0.0', | ||
| maxValue: '1.0', |
Contributor
Comment on lines
+499
to
+500
| minValue: '0.0', | ||
| maxValue: '1.0', |
Contributor
Comment on lines
+525
to
+526
| minValue: '0.0', | ||
| maxValue: '1.0', |
Contributor
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.
Adds SemanticsRole.slider, minValue, and maxValue to Slider semantics.
issue: flutter/flutter#184030
blocked by flutter/flutter#184029
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