Skip to content

Conversation

@salihgueler
Copy link
Contributor

This PR is adding semantics label and Semantics to FadeInImage. It has two semantics label one for placeholder and another for the real image. It brings the semantics label according to the image shown on screen. I got the idea to add different semantics for placeholder and image from @jonahwilliams on the related issue.

This fixes #26040

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Mar 3, 2019
@salihgueler
Copy link
Contributor Author

I signed it!

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a test that verifies that the correct label is used when the placeholder or regular image is shown.

matchTextDirection: widget.matchTextDirection,
);

if (widget.excludeFromSemantics)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Include { } around block

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer this usage as well, I haven't included them because it was used this way in the Image class. I will add it.

return _isShowingPlaceholder
? _placeholderResolver._imageInfo
: _imageResolver._imageInfo;
? _placeholderResolver._imageInfo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: revert unrelated change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true, I reverted it. 👍


String get _semanticLabel {
return _isShowingPlaceholder
? widget.placeholderSemanticLabel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 2 space indent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it as well 👍

@salihgueler
Copy link
Contributor Author

@jonahwilliams All changes requested are done.

@goderbauer goderbauer added the framework flutter/packages/flutter repository. See also f: labels. label Mar 4, 2019
@goderbauer
Copy link
Member

@salihgueler
Copy link
Contributor Author

@goderbauer Just fixed it, sorry about that :)

@jonahwilliams
Copy link
Contributor

LGTM

@jonahwilliams jonahwilliams merged commit 11678da into flutter:master Mar 6, 2019
@tvolkert
Copy link
Contributor

@salihgueler in #33370 I propose that we remove the placeholderSemanticLabel property. The logic is that a placeholder image is a transient visual artifact, not something that affects the underlying semantic meaning of the image -- and that the semantic label should persist across the loading of the image.

Based on a quick code search, I didn't see any usages of this property either.

Do you have any objections to this removal? If so, please comment in #33370

Thanks!

tvolkert added a commit that referenced this pull request May 31, 2019
This updates FadeInImage to use the new Image.frameBuilder
API (added in #33369), to greatly simplify the implementation
of FadeInImage.

This also removes the FadeInImage.placeholderSemanticLabel property.
This property was added in #28799 for the sake of completeness (the bug
it fixed was the lack of any semantic label support in FadeInImage), but a
placeholder is a transient visual artifact, not something that affects the
underlying semantic meaning of the image.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FadeInImage] - Does not support Accessibility Text (semanticLabel)

5 participants