Photo search: Add image, download button semantics (#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.
pull/993/head
Chris Bracken 3 years ago committed by GitHub
parent 8da15e2059
commit 6f78a89a61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -78,6 +78,7 @@ class _PhotoDetailsState extends State<PhotoDetails> {
), ),
child: FadeInImage.memoryNetwork( child: FadeInImage.memoryNetwork(
placeholder: kTransparentImage, placeholder: kTransparentImage,
imageSemanticLabel: widget.photo.description,
image: widget.photo.urls!.small!, image: widget.photo.urls!.small!,
), ),
), ),
@ -94,6 +95,7 @@ class _PhotoDetailsState extends State<PhotoDetails> {
_buildPhotoAttribution(context), _buildPhotoAttribution(context),
const SizedBox(width: 8), const SizedBox(width: 8),
IconButton( IconButton(
tooltip: 'Download',
visualDensity: VisualDensity.compact, visualDensity: VisualDensity.compact,
icon: const Icon(Icons.cloud_download), icon: const Icon(Icons.cloud_download),
onPressed: () => widget.onPhotoSave(widget.photo), onPressed: () => widget.onPhotoSave(widget.photo),

Loading…
Cancel
Save