@@ -37,6 +37,7 @@ import 'list.dart';
3737import 'live_region.dart' ;
3838import 'menus.dart' ;
3939import 'platform_view.dart' ;
40+ import 'progress_bar.dart' ;
4041import 'requirable.dart' ;
4142import 'route.dart' ;
4243import 'scrollable.dart' ;
@@ -275,6 +276,8 @@ class SemanticsNodeUpdate {
275276 this .hitTestBehavior = ui.SemanticsHitTestBehavior .defer,
276277 required this .inputType,
277278 required this .locale,
279+ required this .minValue,
280+ required this .maxValue,
278281 });
279282
280283 /// See [ui.SemanticsUpdateBuilder.updateNode] .
@@ -399,6 +402,12 @@ class SemanticsNodeUpdate {
399402
400403 /// See [ui.SemanticsUpdateBuilder.updateNode] .
401404 final ui.Locale ? locale;
405+
406+ /// See [ui.SemanticsUpdateBuilder.updateNode] .
407+ final String minValue;
408+
409+ /// See [ui.SemanticsUpdateBuilder.updateNode] .
410+ final String maxValue;
402411}
403412
404413/// Identifies [SemanticRole] implementations.
@@ -503,6 +512,12 @@ enum EngineSemanticsRole {
503512 /// An item in a [list] .
504513 listItem,
505514
515+ /// A graphic object that shows progress with a numeric number.
516+ progressBar,
517+
518+ /// A graphic object that spins to indicate the application is busy.
519+ loadingSpinner,
520+
506521 /// A role used when a more specific role cannot be assigend to
507522 /// a [SemanticsObject] .
508523 ///
@@ -1550,6 +1565,31 @@ class SemanticsObject {
15501565 _dirtyFields | = _hitTestBehaviorIndex;
15511566 }
15521567
1568+ String ? get minValue => _minValue;
1569+ String ? _minValue;
1570+
1571+ static const int _minValueIndex = 1 << 29 ;
1572+
1573+ /// Whether the [minValue] field has been updated but has not been
1574+ /// applied to the DOM yet.
1575+ bool get isMinValueDirty => _isDirty (_minValueIndex);
1576+ void _markMinValueDirty () {
1577+ _dirtyFields | = _minValueIndex;
1578+ }
1579+
1580+ /// See [ui.SemanticsUpdateBuilder.updateNode] .
1581+ String ? get maxValue => _maxValue;
1582+ String ? _maxValue;
1583+
1584+ static const int _maxValueIndex = 1 << 30 ;
1585+
1586+ /// Whether the [maxValue] field has been updated but has not been
1587+ /// applied to the DOM yet.
1588+ bool get isMaxValueDirty => _isDirty (_maxValueIndex);
1589+ void _markMaxValueDirty () {
1590+ _dirtyFields | = _maxValueIndex;
1591+ }
1592+
15531593 /// A unique permanent identifier of the semantics node in the tree.
15541594 final int id;
15551595
@@ -1887,6 +1927,16 @@ class SemanticsObject {
18871927 _markHitTestBehaviorDirty ();
18881928 }
18891929
1930+ if (_minValue != update.minValue) {
1931+ _minValue = update.minValue;
1932+ _markMinValueDirty ();
1933+ }
1934+
1935+ if (_maxValue != update.maxValue) {
1936+ _maxValue = update.maxValue;
1937+ _markMaxValueDirty ();
1938+ }
1939+
18901940 role = update.role;
18911941
18921942 inputType = update.inputType;
@@ -2139,14 +2189,16 @@ class SemanticsObject {
21392189 return EngineSemanticsRole .region;
21402190 case ui.SemanticsRole .form:
21412191 return EngineSemanticsRole .form;
2192+ case ui.SemanticsRole .loadingSpinner:
2193+ return EngineSemanticsRole .loadingSpinner;
2194+ case ui.SemanticsRole .progressBar:
2195+ return EngineSemanticsRole .progressBar;
21422196 // TODO(chunhtai): implement these roles.
21432197 // https://github.com/flutter/flutter/issues/159741.
21442198 case ui.SemanticsRole .dragHandle:
21452199 case ui.SemanticsRole .spinButton:
21462200 case ui.SemanticsRole .comboBox:
21472201 case ui.SemanticsRole .tooltip:
2148- case ui.SemanticsRole .loadingSpinner:
2149- case ui.SemanticsRole .progressBar:
21502202 case ui.SemanticsRole .hotKey:
21512203 case ui.SemanticsRole .none:
21522204 // fallback to checking semantics properties.
@@ -2213,6 +2265,8 @@ class SemanticsObject {
22132265 EngineSemanticsRole .menuItemRadio => SemanticMenuItemRadio (this ),
22142266 EngineSemanticsRole .alert => SemanticAlert (this ),
22152267 EngineSemanticsRole .status => SemanticStatus (this ),
2268+ EngineSemanticsRole .progressBar => SemanticsProgressBar (this ),
2269+ EngineSemanticsRole .loadingSpinner => SementicsLoadingSpinner (this ),
22162270 EngineSemanticsRole .generic => GenericRole (this ),
22172271 EngineSemanticsRole .complementary => SemanticComplementary (this ),
22182272 EngineSemanticsRole .contentInfo => SemanticContentInfo (this ),
0 commit comments