From fcac28d65d7aa3b418d300e0b14595aa658e7089 Mon Sep 17 00:00:00 2001 From: Per Classon Date: Wed, 29 Jan 2020 16:46:34 +0100 Subject: [PATCH] [Gallery] Exclude semantics for logo and change to hint for products on Shrine (#292) * Exclude logo from semantics * Use hint instead of onTapHint as it otherwise won't work with VoiceOver --- gallery/gallery/lib/studies/shrine/login.dart | 23 +++++++++---------- .../shrine/supplemental/product_card.dart | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/gallery/gallery/lib/studies/shrine/login.dart b/gallery/gallery/lib/studies/shrine/login.dart index 9d7a47c2b..7d2b1b596 100644 --- a/gallery/gallery/lib/studies/shrine/login.dart +++ b/gallery/gallery/lib/studies/shrine/login.dart @@ -85,18 +85,17 @@ 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'), + const SizedBox(height: 16), + Text( + 'SHRINE', + style: Theme.of(context).textTheme.headline, + ), + ], + ), ); } } diff --git a/gallery/gallery/lib/studies/shrine/supplemental/product_card.dart b/gallery/gallery/lib/studies/shrine/supplemental/product_card.dart index 16165f3f7..fa67885da 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: () {