Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions lib/ui/semantics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 8 additions & 2 deletions lib/web_ui/lib/semantics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down