From 3156c288829a0c6a307b7dea8a0c6c6a2c678075 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Mon, 30 Jul 2018 09:28:24 -0700 Subject: [PATCH] Improve semantics for Drawer-Demo (#19911) --- .../lib/demo/material/drawer_demo.dart | 43 +++++++++++-------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/examples/flutter_gallery/lib/demo/material/drawer_demo.dart b/examples/flutter_gallery/lib/demo/material/drawer_demo.dart index 8a551b9138..28f13b9b1c 100644 --- a/examples/flutter_gallery/lib/demo/material/drawer_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/drawer_demo.dart @@ -201,29 +201,34 @@ class _DrawerDemoState extends State with TickerProviderStateMixin { onTap: () { _scaffoldKey.currentState.openDrawer(); }, - child: new Column( - mainAxisSize: MainAxisSize.min, - children: [ - new Container( - width: 100.0, - height: 100.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - image: const DecorationImage( - image: const AssetImage( - _kAsset0, - package: _kGalleryAssetsPackage, + child: new Semantics( + button: true, + label: 'Open drawer', + excludeSemantics: true, + child: new Column( + mainAxisSize: MainAxisSize.min, + children: [ + new Container( + width: 100.0, + height: 100.0, + decoration: const BoxDecoration( + shape: BoxShape.circle, + image: const DecorationImage( + image: const AssetImage( + _kAsset0, + package: _kGalleryAssetsPackage, + ), ), ), ), - ), - new Padding( - padding: const EdgeInsets.only(top: 8.0), - child: new Text('Tap here to open the drawer', - style: Theme.of(context).textTheme.subhead, + new Padding( + padding: const EdgeInsets.only(top: 8.0), + child: new Text('Tap here to open the drawer', + style: Theme.of(context).textTheme.subhead, + ), ), - ), - ], + ], + ), ), ), ),