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

Commit 9686c23

Browse files
committed
Add missing kHasImplicitScrolling enum value
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.
1 parent 39c46de commit 9686c23

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

lib/ui/semantics.dart

Lines changed: 3 additions & 2 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;

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 focus to an offscreen child.
146+
//
147+
// For example, a ListView widget has implicit scrolling so that users can
148+
// easily move to the next visible set of children. A TabBar widget does not
149+
// have implicit scrolling, so that users can navigate into the tab body when
150+
// reaching the end of the tab bar.
151+
kFlutterSemanticsFlagHasImplicitScrolling = 1 << 18,
144152
} FlutterSemanticsFlag;
145153

146154
typedef enum {

0 commit comments

Comments
 (0)