diff --git a/packages/flutter/lib/src/widgets/scrollable.dart b/packages/flutter/lib/src/widgets/scrollable.dart index e5fb0584f6a..d6768c05a51 100644 --- a/packages/flutter/lib/src/widgets/scrollable.dart +++ b/packages/flutter/lib/src/widgets/scrollable.dart @@ -527,7 +527,7 @@ class ScrollableState extends State with TickerProviderStateMixin key: _scrollSemanticsKey, child: result, position: position, - allowImplicitScrolling: widget?.physics?.allowImplicitScrolling ?? false, + allowImplicitScrolling: widget?.physics?.allowImplicitScrolling ?? _physics.allowImplicitScrolling, semanticChildCount: widget.semanticChildCount, ); } diff --git a/packages/flutter/test/cupertino/action_sheet_test.dart b/packages/flutter/test/cupertino/action_sheet_test.dart index 9a7e63a208c..0c450341c7c 100644 --- a/packages/flutter/test/cupertino/action_sheet_test.dart +++ b/packages/flutter/test/cupertino/action_sheet_test.dart @@ -873,6 +873,9 @@ void main() { label: 'Alert', children: [ TestSemantics( + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], children: [ TestSemantics( label: 'The title', @@ -883,6 +886,9 @@ void main() { ], ), TestSemantics( + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], children: [ TestSemantics( flags: [ diff --git a/packages/flutter/test/cupertino/dialog_test.dart b/packages/flutter/test/cupertino/dialog_test.dart index 29a3bccb9ec..d1f58dfeaa0 100644 --- a/packages/flutter/test/cupertino/dialog_test.dart +++ b/packages/flutter/test/cupertino/dialog_test.dart @@ -92,12 +92,18 @@ void main() { label: 'Alert', children: [ TestSemantics( + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], children: [ TestSemantics(label: 'The Title'), TestSemantics(label: 'Content'), ], ), TestSemantics( + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], children: [ TestSemantics( flags: [SemanticsFlag.isButton], diff --git a/packages/flutter/test/material/dropdown_test.dart b/packages/flutter/test/material/dropdown_test.dart index 55ab9b8b29e..a76af9042c5 100644 --- a/packages/flutter/test/material/dropdown_test.dart +++ b/packages/flutter/test/material/dropdown_test.dart @@ -788,6 +788,9 @@ void main() { TestSemantics( children: [ TestSemantics( + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], children: [ TestSemantics( label: 'one', diff --git a/packages/flutter/test/material/popup_menu_test.dart b/packages/flutter/test/material/popup_menu_test.dart index eba243b7dda..59c1f85cb50 100644 --- a/packages/flutter/test/material/popup_menu_test.dart +++ b/packages/flutter/test/material/popup_menu_test.dart @@ -509,6 +509,9 @@ void main() { textDirection: TextDirection.ltr, children: [ TestSemantics( + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], children: [ TestSemantics( actions: [SemanticsAction.tap], diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart index 5eab06630c0..52abbd1043b 100644 --- a/packages/flutter/test/material/tabs_test.dart +++ b/packages/flutter/test/material/tabs_test.dart @@ -1465,6 +1465,7 @@ void main() { TestSemantics( id: 3, rect: TestSemantics.fullScreen, + flags: [SemanticsFlag.hasImplicitScrolling], children: [ TestSemantics( id: 4, @@ -1728,6 +1729,7 @@ void main() { TestSemantics( id: 3, rect: TestSemantics.fullScreen, + flags: [SemanticsFlag.hasImplicitScrolling], children: [ TestSemantics( id: 4, diff --git a/packages/flutter/test/widgets/draggable_test.dart b/packages/flutter/test/widgets/draggable_test.dart index 3f5fc7285b0..97941fce20b 100644 --- a/packages/flutter/test/widgets/draggable_test.dart +++ b/packages/flutter/test/widgets/draggable_test.dart @@ -1990,6 +1990,7 @@ void main() { children: [ TestSemantics( id: 8, + flags: [SemanticsFlag.hasImplicitScrolling], actions: [SemanticsAction.scrollLeft], children: [ TestSemantics( @@ -2050,6 +2051,7 @@ void main() { children: [ TestSemantics( id: 8, + flags: [SemanticsFlag.hasImplicitScrolling], children: [ TestSemantics( id: 4, diff --git a/packages/flutter/test/widgets/list_view_test.dart b/packages/flutter/test/widgets/list_view_test.dart index 89e4978916d..c6f05279901 100644 --- a/packages/flutter/test/widgets/list_view_test.dart +++ b/packages/flutter/test/widgets/list_view_test.dart @@ -500,4 +500,37 @@ void main() { expect(find.byType(Viewport), isNot(paints..clipRect())); }); + + testWidgets('ListView.horizontal has implicit scrolling by default', (WidgetTester tester) async { + final SemanticsHandle handle = tester.ensureSemantics(); + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: Center( + child: Container( + height: 200.0, + child: ListView( + scrollDirection: Axis.horizontal, + itemExtent: 100.0, + children: [ + Container( + height: 100.0, + ), + ], + ), + ), + ), + ), + ); + expect(tester.getSemantics(find.byType(Scrollable)), matchesSemantics( + children: [ + matchesSemantics( + children: [ + matchesSemantics(hasImplicitScrolling: true) + ], + ), + ], + )); + handle.dispose(); + }); } diff --git a/packages/flutter/test/widgets/scrollable_semantics_traversal_order_test.dart b/packages/flutter/test/widgets/scrollable_semantics_traversal_order_test.dart index fafd477d1a7..9d7467900a3 100644 --- a/packages/flutter/test/widgets/scrollable_semantics_traversal_order_test.dart +++ b/packages/flutter/test/widgets/scrollable_semantics_traversal_order_test.dart @@ -65,6 +65,9 @@ void main() { TestSemantics( scrollIndex: 15, scrollChildren: 30, + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], actions: [ SemanticsAction.scrollUp, SemanticsAction.scrollDown, @@ -234,6 +237,9 @@ void main() { TestSemantics( children: [ TestSemantics( + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], actions: [ SemanticsAction.scrollUp, SemanticsAction.scrollDown, @@ -360,8 +366,13 @@ void main() { TestSemantics( children: [ TestSemantics( - actions: [SemanticsAction.scrollUp, - SemanticsAction.scrollDown], + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], + actions: [ + SemanticsAction.scrollUp, + SemanticsAction.scrollDown, + ], children: [ TestSemantics( flags: [SemanticsFlag.isHidden], @@ -492,6 +503,9 @@ void main() { TestSemantics( children: [ TestSemantics( + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], actions: [ SemanticsAction.scrollUp, SemanticsAction.scrollDown, @@ -624,6 +638,9 @@ void main() { textDirection: TextDirection.ltr, children: [ TestSemantics( + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], actions: [ SemanticsAction.scrollUp, SemanticsAction.scrollDown, @@ -760,6 +777,9 @@ void main() { TestSemantics( children: [ TestSemantics( + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], actions: [ SemanticsAction.scrollUp, SemanticsAction.scrollDown, diff --git a/packages/flutter/test/widgets/single_child_scroll_view_test.dart b/packages/flutter/test/widgets/single_child_scroll_view_test.dart index 6c86c43e0b0..816644e1a66 100644 --- a/packages/flutter/test/widgets/single_child_scroll_view_test.dart +++ b/packages/flutter/test/widgets/single_child_scroll_view_test.dart @@ -201,6 +201,9 @@ void main() { TestSemantics( children: [ TestSemantics( + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], actions: [ SemanticsAction.scrollUp, ], @@ -244,6 +247,9 @@ void main() { TestSemantics( children: [ TestSemantics( + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], actions: [ SemanticsAction.scrollUp, SemanticsAction.scrollDown, @@ -303,6 +309,9 @@ void main() { TestSemantics( children: [ TestSemantics( + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], actions: [ SemanticsAction.scrollDown, ], diff --git a/packages/flutter/test/widgets/sliver_semantics_test.dart b/packages/flutter/test/widgets/sliver_semantics_test.dart index 70373e41aaf..1ad33d78533 100644 --- a/packages/flutter/test/widgets/sliver_semantics_test.dart +++ b/packages/flutter/test/widgets/sliver_semantics_test.dart @@ -79,6 +79,9 @@ void _tests() { children: [ TestSemantics( id: 9, + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], actions: [SemanticsAction.scrollUp], children: [ TestSemantics( @@ -222,6 +225,9 @@ void _tests() { children: [ TestSemantics( id: 9, + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], actions: [ SemanticsAction.scrollUp, SemanticsAction.scrollDown, @@ -327,6 +333,9 @@ void _tests() { TestSemantics( children: [ TestSemantics( + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], actions: [ SemanticsAction.scrollUp, SemanticsAction.scrollDown, @@ -715,6 +724,9 @@ void _tests() { TestSemantics( children: [ TestSemantics( + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], actions: [ SemanticsAction.scrollUp, SemanticsAction.scrollDown, @@ -825,8 +837,13 @@ void _tests() { TestSemantics( children: [ TestSemantics( - actions: [SemanticsAction.scrollUp, - SemanticsAction.scrollDown], + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], + actions: [ + SemanticsAction.scrollUp, + SemanticsAction.scrollDown, + ], children: [ TestSemantics( flags: [SemanticsFlag.isHidden], @@ -1031,6 +1048,9 @@ void _tests() { TestSemantics( children: [ TestSemantics( + flags: [ + SemanticsFlag.hasImplicitScrolling, + ], actions: [ SemanticsAction.scrollUp, SemanticsAction.scrollDown,