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 { ...@@ -3565,6 +3565,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
bool? toggled, bool? toggled,
bool? selected, bool? selected,
bool? button, bool? button,
bool? slider,
bool? link, bool? link,
bool? header, bool? header,
bool? textField, bool? textField,
...@@ -3618,6 +3619,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox { ...@@ -3618,6 +3619,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
_toggled = toggled, _toggled = toggled,
_selected = selected, _selected = selected,
_button = button, _button = button,
_slider = slider,
_link = link, _link = link,
_header = header, _header = header,
_textField = textField, _textField = textField,
...@@ -3764,6 +3766,17 @@ class RenderSemanticsAnnotations extends RenderProxyBox { ...@@ -3764,6 +3766,17 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
markNeedsSemanticsUpdate(); 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 /// If non-null, sets the [SemanticsConfiguration.isLink] semantic to the
/// given value. /// given value.
bool? get link => _link; bool? get link => _link;
...@@ -4477,6 +4490,8 @@ class RenderSemanticsAnnotations extends RenderProxyBox { ...@@ -4477,6 +4490,8 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
config.isButton = button!; config.isButton = button!;
if (link != null) if (link != null)
config.isLink = link!; config.isLink = link!;
if (slider != null)
config.isSlider = slider!;
if (header != null) if (header != null)
config.isHeader = header!; config.isHeader = header!;
if (textField != null) if (textField != null)
......
...@@ -596,6 +596,7 @@ class SemanticsProperties extends DiagnosticableTree { ...@@ -596,6 +596,7 @@ class SemanticsProperties extends DiagnosticableTree {
this.link, this.link,
this.header, this.header,
this.textField, this.textField,
this.slider,
this.readOnly, this.readOnly,
this.focusable, this.focusable,
this.focused, this.focused,
...@@ -694,6 +695,12 @@ class SemanticsProperties extends DiagnosticableTree { ...@@ -694,6 +695,12 @@ class SemanticsProperties extends DiagnosticableTree {
/// text field. /// text field.
final bool? textField; 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. /// If non-null, indicates that this subtree is read only.
/// ///
/// Only applicable when [textField] is true. /// Only applicable when [textField] is true.
...@@ -3640,6 +3647,12 @@ class SemanticsConfiguration { ...@@ -3640,6 +3647,12 @@ class SemanticsConfiguration {
_setFlag(SemanticsFlag.isHeader, value); _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. /// Whether the owning [RenderObject] is considered hidden.
/// ///
/// Hidden elements are currently not visible on screen. They may be covered /// Hidden elements are currently not visible on screen. They may be covered
......
...@@ -6662,6 +6662,7 @@ class Semantics extends SingleChildRenderObjectWidget { ...@@ -6662,6 +6662,7 @@ class Semantics extends SingleChildRenderObjectWidget {
bool? selected, bool? selected,
bool? toggled, bool? toggled,
bool? button, bool? button,
bool? slider,
bool? link, bool? link,
bool? header, bool? header,
bool? textField, bool? textField,
...@@ -6717,6 +6718,7 @@ class Semantics extends SingleChildRenderObjectWidget { ...@@ -6717,6 +6718,7 @@ class Semantics extends SingleChildRenderObjectWidget {
toggled: toggled, toggled: toggled,
selected: selected, selected: selected,
button: button, button: button,
slider: slider,
link: link, link: link,
header: header, header: header,
textField: textField, textField: textField,
...@@ -6831,6 +6833,7 @@ class Semantics extends SingleChildRenderObjectWidget { ...@@ -6831,6 +6833,7 @@ class Semantics extends SingleChildRenderObjectWidget {
toggled: properties.toggled, toggled: properties.toggled,
selected: properties.selected, selected: properties.selected,
button: properties.button, button: properties.button,
slider: properties.slider,
link: properties.link, link: properties.link,
header: properties.header, header: properties.header,
textField: properties.textField, textField: properties.textField,
...@@ -6902,6 +6905,7 @@ class Semantics extends SingleChildRenderObjectWidget { ...@@ -6902,6 +6905,7 @@ class Semantics extends SingleChildRenderObjectWidget {
..toggled = properties.toggled ..toggled = properties.toggled
..selected = properties.selected ..selected = properties.selected
..button = properties.button ..button = properties.button
..slider = properties.slider
..link = properties.link ..link = properties.link
..header = properties.header ..header = properties.header
..textField = properties.textField ..textField = properties.textField
......
...@@ -414,6 +414,7 @@ void _defineTests() { ...@@ -414,6 +414,7 @@ void _defineTests() {
selected: true, selected: true,
hidden: true, hidden: true,
button: true, button: true,
slider: true,
link: true, link: true,
textField: true, textField: true,
readOnly: true, readOnly: true,
...@@ -464,6 +465,7 @@ void _defineTests() { ...@@ -464,6 +465,7 @@ void _defineTests() {
selected: true, selected: true,
hidden: true, hidden: true,
button: true, button: true,
slider: true,
link: true, link: true,
textField: true, textField: true,
readOnly: true, readOnly: true,
......
...@@ -475,6 +475,7 @@ void main() { ...@@ -475,6 +475,7 @@ void main() {
checked: true, checked: true,
selected: true, selected: true,
button: true, button: true,
slider: true,
link: true, link: true,
textField: true, textField: true,
readOnly: 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