Skip to content

[material_ui] Add SemanticsRole.slider to Slider - #12709

Draft
hannah-hyj wants to merge 1 commit into
flutter:mainfrom
hannah-hyj:material-slider-semantics-role
Draft

[material_ui] Add SemanticsRole.slider to Slider#12709
hannah-hyj wants to merge 1 commit into
flutter:mainfrom
hannah-hyj:material-slider-semantics-role

Conversation

@hannah-hyj

Copy link
Copy Markdown
Member

Adds SemanticsRole.slider, minValue, and maxValue to Slider semantics.

issue: flutter/flutter#184030

blocked by flutter/flutter#184029

Pre-Review 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-assist bot 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

  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. 2

Adds SemanticsRole.slider, minValue, and maxValue to Slider semantics.

Fixes flutter/flutter#184030
Related to flutter/flutter#184029
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Sep 1, 2026
@github-actions github-actions Bot added p: material_ui triage-design Should be looked at in design triage labels Sep 1, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds SemanticsRole.slider and min/max value bounds to the Slider semantics configuration, updating both the implementation and corresponding tests. Feedback suggests accessing the RenderObject's own min and max properties directly rather than through _state.widget to improve encapsulation.

Comment on lines +1998 to +1999
config.minValue = _state.widget.min.toString();
config.maxValue = _state.widget.max.toString();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Instead of accessing the widget's properties directly via _state.widget.min and _state.widget.max, it is more idiomatic to use the RenderObject's own min and max properties. This respects the encapsulation of the RenderObject and ensures consistency with how other properties are accessed.

    config.minValue = min.toString();
    config.maxValue = max.toString();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD p: material_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant