Accessibility fixes for new gallery (#16973)
diff --git a/examples/flutter_gallery/lib/gallery/backdrop.dart b/examples/flutter_gallery/lib/gallery/backdrop.dart index 205ab26..0c70c96 100644 --- a/examples/flutter_gallery/lib/gallery/backdrop.dart +++ b/examples/flutter_gallery/lib/gallery/backdrop.dart
@@ -46,7 +46,7 @@ void initState() { super.initState(); widget.controller.addStatusListener(_handleStatusChange); - _ignoring = widget.controller.status != AnimationStatus.completed; + _ignoring = widget.controller.status != widget.status; } @override @@ -283,7 +283,7 @@ ), trailing: new IconButton( onPressed: _toggleFrontLayer, - tooltip: 'Show options page', + tooltip: 'Toggle options page', icon: new AnimatedIcon( icon: AnimatedIcons.close_menu, progress: _controller, @@ -328,14 +328,16 @@ ), new PositionedTransition( rect: frontRelativeRect, - child: new Container( - alignment: Alignment.topLeft, - child: new GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: _toggleFrontLayer, - onVerticalDragUpdate: _handleDragUpdate, - onVerticalDragEnd: _handleDragEnd, - child: widget.frontHeading, + child: new ExcludeSemantics( + child: new Container( + alignment: Alignment.topLeft, + child: new GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: _toggleFrontLayer, + onVerticalDragUpdate: _handleDragUpdate, + onVerticalDragEnd: _handleDragEnd, + child: widget.frontHeading, + ), ), ), ),
diff --git a/examples/flutter_gallery/lib/gallery/options.dart b/examples/flutter_gallery/lib/gallery/options.dart index f3fbe02..7f9064c 100644 --- a/examples/flutter_gallery/lib/gallery/options.dart +++ b/examples/flutter_gallery/lib/gallery/options.dart
@@ -96,17 +96,19 @@ Widget build(BuildContext context) { final double textScaleFactor = MediaQuery.of(context)?.textScaleFactor ?? 1.0; - return new Container( - constraints: new BoxConstraints(minHeight: _kItemHeight * textScaleFactor), - padding: _kItemPadding, - alignment: AlignmentDirectional.centerStart, - child: new DefaultTextStyle( - style: DefaultTextStyle.of(context).style, - maxLines: 2, - overflow: TextOverflow.fade, - child: new IconTheme( - data: Theme.of(context).primaryIconTheme, - child: child, + return new MergeSemantics( + child: new Container( + constraints: new BoxConstraints(minHeight: _kItemHeight * textScaleFactor), + padding: _kItemPadding, + alignment: AlignmentDirectional.centerStart, + child: new DefaultTextStyle( + style: DefaultTextStyle.of(context).style, + maxLines: 2, + overflow: TextOverflow.fade, + child: new IconTheme( + data: Theme.of(context).primaryIconTheme, + child: child, + ), ), ), );
diff --git a/examples/flutter_gallery/test/drawer_test.dart b/examples/flutter_gallery/test/drawer_test.dart index bcc1203..1315a43 100644 --- a/examples/flutter_gallery/test/drawer_test.dart +++ b/examples/flutter_gallery/test/drawer_test.dart
@@ -26,7 +26,7 @@ await tester.pump(); // triggers a frame // Show the options page - await tester.tap(find.byTooltip('Show options page')); + await tester.tap(find.byTooltip('Toggle options page')); await tester.pumpAndSettle(); MaterialApp app = find.byType(MaterialApp).evaluate().first.widget; @@ -89,7 +89,7 @@ expect(hasFeedback, true); // Hide the options page - await tester.tap(find.byTooltip('Show options page')); + await tester.tap(find.byTooltip('Toggle options page')); await tester.pumpAndSettle(); }); }
diff --git a/examples/flutter_gallery/test/simple_smoke_test.dart b/examples/flutter_gallery/test/simple_smoke_test.dart index 21baf51..553cdac 100644 --- a/examples/flutter_gallery/test/simple_smoke_test.dart +++ b/examples/flutter_gallery/test/simple_smoke_test.dart
@@ -16,7 +16,7 @@ await tester.pump(); // see https://github.com/flutter/flutter/issues/1865 await tester.pump(); // triggers a frame - final Finder showOptionsPageButton = find.byTooltip('Show options page'); + final Finder showOptionsPageButton = find.byTooltip('Toggle options page'); // Show the options page await tester.tap(showOptionsPageButton);
diff --git a/examples/flutter_gallery/test/smoke_test.dart b/examples/flutter_gallery/test/smoke_test.dart index 1b50073..82636ba 100644 --- a/examples/flutter_gallery/test/smoke_test.dart +++ b/examples/flutter_gallery/test/smoke_test.dart
@@ -96,7 +96,7 @@ } Future<Null> smokeOptionsPage(WidgetTester tester) async { - final Finder showOptionsPageButton = find.byTooltip('Show options page'); + final Finder showOptionsPageButton = find.byTooltip('Toggle options page'); // Show the options page await tester.tap(showOptionsPageButton);