mirror of
https://github.com/flutter/samples.git
synced 2025-11-09 06:18:49 +00:00
Adds semantic labels to images and modal close button (#56)
* Added semantic labels to images. * Reverting project file. * Semantic label for close button.
This commit is contained in:
committed by
Filip Hracek
parent
fe72ed957f
commit
cf95d2c3a3
@@ -76,6 +76,7 @@ class DetailsScreen extends StatelessWidget {
|
|||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
veggie.imageAssetPath,
|
veggie.imageAssetPath,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
|
semanticLabel: 'A background image of ${veggie.name}',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ class _ColorChangingIconState
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Icon(
|
return Icon(
|
||||||
widget.icon,
|
widget.icon,
|
||||||
|
semanticLabel: 'Close button',
|
||||||
size: widget.size,
|
size: widget.size,
|
||||||
color: _colorTween?.evaluate(animation),
|
color: _colorTween?.evaluate(animation),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ class VeggieCard extends StatelessWidget {
|
|||||||
Image.asset(
|
Image.asset(
|
||||||
veggie.imageAssetPath,
|
veggie.imageAssetPath,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
|
semanticLabel: 'A card background featuring ${veggie.name}',
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: 0.0,
|
bottom: 0.0,
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ class VeggieHeadline extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
veggie.imageAssetPath,
|
veggie.imageAssetPath,
|
||||||
|
semanticLabel: 'An icon showing ${veggie.name}',
|
||||||
fit: BoxFit.fitWidth,
|
fit: BoxFit.fitWidth,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user