diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index d4da11eafd825..832efd1a4d294 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -13,7 +13,7 @@ part of dart.ui; /// See also: /// - file://./../../lib/ui/semantics/semantics_node.h class SemanticsAction { - const SemanticsAction._(this.index); + const SemanticsAction._(this.index): value = index; static const int _kTapIndex = 1 << 0; static const int _kLongPressIndex = 1 << 1; @@ -46,6 +46,11 @@ class SemanticsAction { /// Each action has one bit set in this bit field. final int index; + /// Temporary API until the following is complete: + /// https://github.com/flutter/flutter/issues/123346 + @Deprecated('This property is temporary and might be removed shortly.') + final int value; + /// The equivalent of a user briefly tapping the screen with the finger /// without moving it. static const SemanticsAction tap = SemanticsAction._(_kTapIndex); @@ -299,13 +304,18 @@ class SemanticsAction { // accessibility services, `flutter_test/controller.dart#SemanticsController._importantFlags` // must be updated as well. class SemanticsFlag { - const SemanticsFlag._(this.index); + const SemanticsFlag._(this.index): value = index; /// The numerical value for this flag. /// /// Each flag has one bit set in this bit field. final int index; + /// Temporary API to represent [index] until the following is complete: + /// https://github.com/flutter/flutter/issues/123346 + @Deprecated('This property is temporary and might be removed shortly.') + final int value; + static const int _kHasCheckedStateIndex = 1 << 0; static const int _kIsCheckedIndex = 1 << 1; static const int _kIsSelectedIndex = 1 << 2; diff --git a/lib/web_ui/lib/semantics.dart b/lib/web_ui/lib/semantics.dart index 81f56500a8ea7..f29f2a1c4d42c 100644 --- a/lib/web_ui/lib/semantics.dart +++ b/lib/web_ui/lib/semantics.dart @@ -5,7 +5,7 @@ part of ui; class SemanticsAction { - const SemanticsAction._(this.index); + const SemanticsAction._(this.index): value = index; static const int _kTapIndex = 1 << 0; static const int _kLongPressIndex = 1 << 1; @@ -32,6 +32,9 @@ class SemanticsAction { final int index; + @Deprecated('This property is temporary and might be removed shortly.') + final int value; + static const SemanticsAction tap = SemanticsAction._(_kTapIndex); static const SemanticsAction longPress = SemanticsAction._(_kLongPressIndex); static const SemanticsAction scrollLeft = SemanticsAction._(_kScrollLeftIndex); @@ -144,10 +147,13 @@ class SemanticsAction { } class SemanticsFlag { - const SemanticsFlag._(this.index); + const SemanticsFlag._(this.index): value = index; final int index; + @Deprecated('This property is temporary and might be removed shortly.') + final int value; + static const int _kHasCheckedStateIndex = 1 << 0; static const int _kIsCheckedIndex = 1 << 1; static const int _kIsSelectedIndex = 1 << 2;