1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-09 06:18:49 +00:00

[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
This commit is contained in:
Per Classon
2020-01-29 16:46:34 +01:00
committed by GitHub
parent bf3979220e
commit fcac28d65d
2 changed files with 12 additions and 13 deletions

View File

@@ -85,18 +85,17 @@ class _ShrineLogo extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return ExcludeSemantics(
children: [ child: Column(
Image.asset( children: [
'packages/shrine_images/diamond.png', Image.asset('packages/shrine_images/diamond.png'),
excludeFromSemantics: true, const SizedBox(height: 16),
), Text(
const SizedBox(height: 16), 'SHRINE',
Text( style: Theme.of(context).textTheme.headline,
'SHRINE', ),
style: Theme.of(context).textTheme.headline, ],
), ),
],
); );
} }
} }

View File

@@ -77,7 +77,7 @@ Widget _buildProductCard({
return ScopedModelDescendant<AppStateModel>( return ScopedModelDescendant<AppStateModel>(
builder: (context, child, model) { builder: (context, child, model) {
return Semantics( return Semantics(
onTapHint: hint:
GalleryLocalizations.of(context).shrineScreenReaderProductAddToCart, GalleryLocalizations.of(context).shrineScreenReaderProductAddToCart,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {