Skip to content

Conversation

@tvolkert
Copy link
Contributor

@tvolkert tvolkert commented May 26, 2019

Description

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.

Related Issues

Tests

I added full test coverage of the two new properties (verified in merged lcov.info). Due to the fact that the implementation of FadeInImage was completely rewritten, I replaced the existing tests with new tests that verify that FadeInImage:

  • animates an uncached image
  • handles updating the placeholder image
  • re-fades in the image when the target image is updated
  • doesn't interrupt in-progress animation when animation values are updated
  • Semantics:
    • only one Semantics node appears within FadeInImage
    • is excluded if excludeFromSemantics is true
    • label
      • defaults to image label
      • is empty without any specified semantics labels

Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

@tvolkert tvolkert requested review from Hixie and goderbauer May 26, 2019 17:00
@tvolkert
Copy link
Contributor Author

@Hixie I significantly re-worked this class. In the process, I got rid of two instance variables:

  • skipFadeOnSynchronousLoad (was proposed new instance variable). I decided not to increase the API surface of the class until a real use case warrants it.
  • placeholderSemanticLabel. This property makes no sense - a placeholder is a transient visual artifact, not something that affects the underlying semantic meaning of the image. A quick code search turned up no usages of this property.

PTAL.

@goderbauer goderbauer added the framework flutter/packages/flutter repository. See also f: labels. label May 28, 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.
@tvolkert
Copy link
Contributor Author

Ok, this has been rebased off of 6884146. I've updated the PR description to account for the breaking change.

PTAL.

@Piinks Piinks added the c: API break Backwards-incompatible API changes label May 30, 2019
@tvolkert tvolkert requested a review from HansMuller May 30, 2019 23:25
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

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

I only reviewed _AnimatedFadeOutFadeIn; looks pretty good to me.

@tvolkert
Copy link
Contributor Author

FYI, waiting for LGTM on this.

I also submitted #33674 for review to address the documentation in ImplicitlyAnimatedWidgetState

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM

@tvolkert tvolkert merged commit 56940b5 into flutter:master May 31, 2019
@tvolkert tvolkert deleted the fade_in_image branch May 31, 2019 21:42
tvolkert added a commit that referenced this pull request Jun 1, 2019
This is a follow-on to #33370 based on review comments
therein.
@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

c: API break Backwards-incompatible API changes framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants