Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit ed628da

Browse files
authored
Add missing kHasImplicitScrolling enum value (#8030)
This brings the Dart and C++ semantics flag enums back in sync. In #5941, implicit scrolling support was added to SemanticsFlag in dart:ui, and to the Android embedder, but not to the SemanticsFlags enum on the C++ side. This also clarifies/corrects the documentation for this value in dart:ui and in the embedder API.
1 parent 052774e commit ed628da

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

lib/ui/semantics.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,9 @@ class SemanticsAction {
264264

265265
/// A Boolean value that can be associated with a semantics node.
266266
//
267-
// When changes are made to this class, the equivalent APIs in each of the
268-
// embedders *must* be updated.
267+
// When changes are made to this class, the equivalent APIs in
268+
// `lib/ui/semantics/semantics_node.h` and in each of the embedders *must* be
269+
// updated.
269270
class SemanticsFlag {
270271
static const int _kHasCheckedStateIndex = 1 << 0;
271272
static const int _kIsCheckedIndex = 1 << 1;
@@ -476,9 +477,9 @@ class SemanticsFlag {
476477
/// to move focus to an offscreen child.
477478
///
478479
/// For example, a [ListView] widget has implicit scrolling so that users can
479-
/// easily move to the next visible set of children. A [TabBar] widget does
480-
/// not have implicit scrolling, so that users can navigate into the tab
481-
/// body when reaching the end of the tab bar.
480+
/// easily move the accessibility focus to the next set of children. A
481+
/// [PageView] widget does not have implicit scrolling, so that users don't
482+
/// navigate to the next page when reaching the end of the current one.
482483
static const SemanticsFlag hasImplicitScrolling = const SemanticsFlag._(_kHasImplicitScrollingIndex);
483484

484485
/// The possible semantics flags.

lib/ui/semantics/semantics_node.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ enum class SemanticsFlags : int32_t {
6565
kIsLiveRegion = 1 << 15,
6666
kHasToggledState = 1 << 16,
6767
kIsToggled = 1 << 17,
68+
kHasImplicitScrolling = 1 << 18,
6869
};
6970

7071
struct SemanticsNode {

shell/platform/embedder/embedder.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ typedef enum {
141141
kFlutterSemanticsFlagHasToggledState = 1 << 16,
142142
// If true, the semantics node is "on". If false, the semantics node is "off".
143143
kFlutterSemanticsFlagIsToggled = 1 << 17,
144+
// Whether the platform can scroll the semantics node when the user attempts
145+
// to move the accessibility focus to an offscreen child.
146+
//
147+
// For example, a |ListView| widget has implicit scrolling so that users can
148+
// easily move the accessibility focus to the next set of children. A
149+
// |PageView| widget does not have implicit scrolling, so that users don't
150+
// navigate to the next page when reaching the end of the current one.
151+
kFlutterSemanticsFlagHasImplicitScrolling = 1 << 18,
144152
} FlutterSemanticsFlag;
145153

146154
typedef enum {

0 commit comments

Comments
 (0)