Skip to content

Commit 6f78a89

Browse files
authored
Photo search: Add image, download button semantics (flutter#989)
Adds the Unsplash photo description, if available, as the image semantics label in the photo detail view. Adds a 'download' tooltip to the download IconButton, which also sets the semantics label for screen readers.
1 parent 8da15e2 commit 6f78a89

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

experimental/desktop_photo_search/lib/src/widgets/photo_details.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ class _PhotoDetailsState extends State<PhotoDetails> {
7878
),
7979
child: FadeInImage.memoryNetwork(
8080
placeholder: kTransparentImage,
81+
imageSemanticLabel: widget.photo.description,
8182
image: widget.photo.urls!.small!,
8283
),
8384
),
@@ -94,6 +95,7 @@ class _PhotoDetailsState extends State<PhotoDetails> {
9495
_buildPhotoAttribution(context),
9596
const SizedBox(width: 8),
9697
IconButton(
98+
tooltip: 'Download',
9799
visualDensity: VisualDensity.compact,
98100
icon: const Icon(Icons.cloud_download),
99101
onPressed: () => widget.onPhotoSave(widget.photo),

0 commit comments

Comments
 (0)