From 6bda919dba538966ed90b845d028003703d65880 Mon Sep 17 00:00:00 2001 From: Per Classon Date: Wed, 29 Jan 2020 15:27:52 +0100 Subject: [PATCH 1/2] Exclude logo from semantics --- gallery/gallery/lib/studies/shrine/login.dart | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/gallery/gallery/lib/studies/shrine/login.dart b/gallery/gallery/lib/studies/shrine/login.dart index 9d7a47c2bde..01f4228c363 100644 --- a/gallery/gallery/lib/studies/shrine/login.dart +++ b/gallery/gallery/lib/studies/shrine/login.dart @@ -85,18 +85,20 @@ class _ShrineLogo extends StatelessWidget { @override Widget build(BuildContext context) { - return Column( - children: [ - Image.asset( - 'packages/shrine_images/diamond.png', - excludeFromSemantics: true, - ), - const SizedBox(height: 16), - Text( - 'SHRINE', - style: Theme.of(context).textTheme.headline, - ), - ], + return ExcludeSemantics( + child: Column( + children: [ + Image.asset( + 'packages/shrine_images/diamond.png', + excludeFromSemantics: true, + ), + const SizedBox(height: 16), + Text( + 'SHRINE', + style: Theme.of(context).textTheme.headline, + ), + ], + ), ); } } From 3496982ab3819013b86be5a6157a1f9ebe5618c5 Mon Sep 17 00:00:00 2001 From: Per Classon Date: Wed, 29 Jan 2020 16:17:11 +0100 Subject: [PATCH 2/2] Use hint instead of onTapHint as it otherwise won't work with VoiceOver --- gallery/gallery/lib/studies/shrine/login.dart | 5 +---- .../lib/studies/shrine/supplemental/product_card.dart | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/gallery/gallery/lib/studies/shrine/login.dart b/gallery/gallery/lib/studies/shrine/login.dart index 01f4228c363..7d2b1b596da 100644 --- a/gallery/gallery/lib/studies/shrine/login.dart +++ b/gallery/gallery/lib/studies/shrine/login.dart @@ -88,10 +88,7 @@ class _ShrineLogo extends StatelessWidget { return ExcludeSemantics( child: Column( children: [ - Image.asset( - 'packages/shrine_images/diamond.png', - excludeFromSemantics: true, - ), + Image.asset('packages/shrine_images/diamond.png'), const SizedBox(height: 16), Text( 'SHRINE', diff --git a/gallery/gallery/lib/studies/shrine/supplemental/product_card.dart b/gallery/gallery/lib/studies/shrine/supplemental/product_card.dart index 16165f3f7fc..fa67885da40 100644 --- a/gallery/gallery/lib/studies/shrine/supplemental/product_card.dart +++ b/gallery/gallery/lib/studies/shrine/supplemental/product_card.dart @@ -77,7 +77,7 @@ Widget _buildProductCard({ return ScopedModelDescendant( builder: (context, child, model) { return Semantics( - onTapHint: + hint: GalleryLocalizations.of(context).shrineScreenReaderProductAddToCart, child: GestureDetector( onTap: () {