-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[cupertino_ui] Add SemanticsRole.slider to CupertinoSlider #12710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| changelog: | | ||
| - Adds `SemanticsRole.slider` and min/max value bounds to `CupertinoSlider` semantics. | ||
| version: patch |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -442,6 +442,9 @@ void main() { | |
| tester.getSemantics(find.byType(CupertinoSlider)), | ||
| matchesSemantics( | ||
| isSlider: true, | ||
| role: SemanticsRole.slider, | ||
| minValue: '0.0', | ||
| maxValue: '1.0', | ||
|
Comment on lines
+446
to
+447
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| hasIncreaseAction: true, | ||
| hasDecreaseAction: true, | ||
| value: '50%', | ||
|
|
@@ -462,7 +465,16 @@ void main() { | |
| ), | ||
| ); | ||
|
|
||
| expect(tester.getSemantics(find.byType(CupertinoSlider)), matchesSemantics(isSlider: true)); | ||
| expect( | ||
| tester.getSemantics(find.byType(CupertinoSlider)), | ||
| matchesSemantics( | ||
| isSlider: true, | ||
| role: SemanticsRole.slider, | ||
| minValue: '0.0', | ||
| maxValue: '1.0', | ||
|
Comment on lines
+473
to
+474
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| value: '50%', | ||
| ), | ||
| ); | ||
|
|
||
| handle.dispose(); | ||
| }); | ||
|
|
@@ -483,6 +495,9 @@ void main() { | |
| tester.getSemantics(find.byType(CupertinoSlider)), | ||
| matchesSemantics( | ||
| isSlider: true, | ||
| role: SemanticsRole.slider, | ||
| minValue: '0.0', | ||
| maxValue: '1.0', | ||
|
Comment on lines
+499
to
+500
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| hasIncreaseAction: true, | ||
| hasDecreaseAction: true, | ||
| value: '50%', | ||
|
|
@@ -506,6 +521,9 @@ void main() { | |
| tester.getSemantics(find.byType(CupertinoSlider)), | ||
| matchesSemantics( | ||
| isSlider: true, | ||
| role: SemanticsRole.slider, | ||
| minValue: '0.0', | ||
| maxValue: '1.0', | ||
|
Comment on lines
+525
to
+526
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| hasIncreaseAction: true, | ||
| hasDecreaseAction: true, | ||
| value: '60%', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Flutter's
SemanticsConfiguration,minValueandmaxValueare of typedouble?, notString?. Assigning aString(viatoString()) will cause a compile-time type mismatch error. They should be assigned directly asdoublevalues.