Unverified Commit d693d2b9 authored by Alexander Brusher's avatar Alexander Brusher Committed by GitHub

Adds getter/setter for slider semantics flag. (#65766)

parent b742816d
......@@ -3565,6 +3565,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
bool? toggled,
bool? selected,
bool? button,
bool? slider,
bool? link,
bool? header,
bool? textField,
......@@ -3618,6 +3619,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
_toggled = toggled,
_selected = selected,
_button = button,
_slider = slider,
_link = link,
_header = header,
_textField = textField,
......@@ -3764,6 +3766,17 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
markNeedsSemanticsUpdate();
}
/// If non-null, sets the [SemanticsConfiguration.isSlider] semantic to the
/// given value.
bool? get slider => _slider;
bool? _slider;
set slider(bool? value) {
if (slider == value)
return;
_slider = value;
markNeedsSemanticsUpdate();
}
/// If non-null, sets the [SemanticsConfiguration.isLink] semantic to the
/// given value.
bool? get link => _link;
......@@ -4477,6 +4490,8 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
config.isButton = button!;
if (link != null)
config.isLink = link!;
if (slider != null)
config.isSlider = slider!;
if (header != null)
config.isHeader = header!;
if (textField != null)
......
......@@ -596,6 +596,7 @@ class SemanticsProperties extends DiagnosticableTree {
this.link,
this.header,
this.textField,
this.slider,
this.readOnly,
this.focusable,
this.focused,
......@@ -694,6 +695,12 @@ class SemanticsProperties extends DiagnosticableTree {
/// text field.
final bool? textField;
/// If non-null, indicates that this subtree represents a slider.
///
/// Talkback/\VoiceOver provides users with the hint "slider" when a
/// slider is focused.
final bool? slider;
/// If non-null, indicates that this subtree is read only.
///
/// Only applicable when [textField] is true.
......@@ -3640,6 +3647,12 @@ class SemanticsConfiguration {
_setFlag(SemanticsFlag.isHeader, value);
}
/// Whether the owning [RenderObject] is a slider (true) or not (false).
bool get isSlider => _hasFlag(SemanticsFlag.isSlider);
set isSlider(bool value) {
_setFlag(SemanticsFlag.isSlider, value);
}
/// Whether the owning [RenderObject] is considered hidden.
///
/// Hidden elements are currently not visible on screen. They may be covered
......
......@@ -6662,6 +6662,7 @@ class Semantics extends SingleChildRenderObjectWidget {
bool? selected,
bool? toggled,
bool? button,
bool? slider,
bool? link,
bool? header,
bool? textField,
......@@ -6717,6 +6718,7 @@ class Semantics extends SingleChildRenderObjectWidget {
toggled: toggled,
selected: selected,
button: button,
slider: slider,
link: link,
header: header,
textField: textField,
......@@ -6831,6 +6833,7 @@ class Semantics extends SingleChildRenderObjectWidget {
toggled: properties.toggled,
selected: properties.selected,
button: properties.button,
slider: properties.slider,
link: properties.link,
header: properties.header,
textField: properties.textField,
......@@ -6902,6 +6905,7 @@ class Semantics extends SingleChildRenderObjectWidget {
..toggled = properties.toggled
..selected = properties.selected
..button = properties.button
..slider = properties.slider
..link = properties.link
..header = properties.header
..textField = properties.textField
......
......@@ -414,6 +414,7 @@ void _defineTests() {
selected: true,
hidden: true,
button: true,
slider: true,
link: true,
textField: true,
readOnly: true,
......@@ -464,6 +465,7 @@ void _defineTests() {
selected: true,
hidden: true,
button: true,
slider: true,
link: true,
textField: true,
readOnly: true,
......
......@@ -475,6 +475,7 @@ void main() {
checked: true,
selected: true,
button: true,
slider: true,
link: true,
textField: true,
readOnly: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment