Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ImageStreamListener.onChunk() #33092

Merged
merged 5 commits into from
May 21, 2019
Merged

Conversation

tvolkert
Copy link
Contributor

Description

This is another step towards supporting image loading
progress notification at the widgets layer.

This adds an ImageChunkEvent class along with associated
ImageChunkListener callback signature and an onChunk
property to ImageStreamListener. The events serve to
notify registered listeners when byte chunks are received
while loading an image.

Related Issues

#32374

Tests

I added the following tests:

  • Verification that an ImageProvider notifies listeners of chunk events
  • Verification that MultiFrameImageStreamCompleter delivers chunk events to listeners
  • Verification that MultiFrameImageStreamCompleter drops chunk events on the floor before listeners are registered (intended behavior).
  • Verification that errors reported on the chunk stream that's passed to MultiFrameImageStreamCompleter are properly reported.

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?

  • Yes, this is a breaking change (Please read [Handling breaking changes]). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

This is another step towards supporting image loading
progress notification at the widgets layer.

This adds an `ImageChunkEvent` class along with associated
`ImageChunkListener` callback signature and an `onChunk`
property to `ImageStreamListener`. The events serve to
notify registered listeners when byte chunks are received
while loading an image.

flutter#32374
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 27d3c2f into flutter:master May 21, 2019
@tvolkert tvolkert deleted the chunks branch May 21, 2019 21:55
tvolkert added a commit to tvolkert/flutter that referenced this pull request May 22, 2019
tvolkert added a commit that referenced this pull request May 23, 2019
kiku-jw pushed a commit to kiku-jw/flutter that referenced this pull request Jun 14, 2019
This is another step towards supporting image loading
progress notification at the widgets layer.

This adds an `ImageChunkEvent` class along with associated
`ImageChunkListener` callback signature and an `onChunk`
property to `ImageStreamListener`. The events serve to
notify registered listeners when byte chunks are received
while loading an image.

flutter#32374
kiku-jw pushed a commit to kiku-jw/flutter that referenced this pull request Jun 14, 2019
@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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants