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 some sanity to the ImageStream listener API #32936

Merged
merged 1 commit into from May 21, 2019
Merged

Conversation

@tvolkert
Copy link
Contributor

@tvolkert tvolkert commented May 17, 2019

Description

The current API was broken in that you registered multiple
callbacks at once, but when you removed listeners, only the
primary listener was used to determine what was removed.
This led to unintuitive cases where the caller could get
unexpected behavior.

This updates the API to add and remove listeners using a
newly introduced [ImageStreamListener] object, a value
object that has references to the individual callbacks that
may fire.

Related Issues

Tests

I updated all affected tests to match the new API/behavior.

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 17, 2019
@Hixie
Copy link
Member

@Hixie Hixie commented May 17, 2019

Your claim that this is not a breaking change is entertaining. :-P

The direction looks good.

cc @xster who wrote this initially.
cc @goderbauer for framework review.

Copy link
Member

@goderbauer goderbauer left a comment

LGTM

packages/flutter/lib/src/painting/image_stream.dart Outdated Show resolved Hide resolved
The current API was broken in that you registered multiple
callbacks at once, but when you removed listeners, only the
primary listener was used to determine what was removed.
This led to unintuitive cases where the caller could get
unexpected behavior.

This updates the API to add and remove listeners using
a newly introduced [ImageStreamListener] object, a value
object that has references to the individual callbacks
that may fire.

flutter#24722
flutter#32374
flutter#32935
@tvolkert tvolkert merged commit 592f81e into flutter:master May 21, 2019
34 checks passed
@tvolkert tvolkert deleted the listeners branch May 21, 2019
mollywoodnini added a commit to mollywoodnini/flutter_plugin_pdf_viewer that referenced this issue May 22, 2019
updated listener handling due to new flutter version: flutter/flutter#32936
DavBfr added a commit to DavBfr/dart_pdf that referenced this issue May 28, 2019
amirh pushed a commit to amirh/plugins that referenced this issue May 28, 2019
This updates the sample to adapt to the ImageStream listener API changes
in flutter/flutter#32936

As we cannot use the new API before it makes it to stable I'm commenting
out the sample for now(if we update it now it won't compile on stable,
and if we leave it as is it breaks CI on master).
amirh pushed a commit to amirh/plugins that referenced this issue May 28, 2019
This updates the sample to adapt to the ImageStream listener API changes
in flutter/flutter#32936

As we cannot use the new API before it makes it to stable I'm commenting
out the sample for now(if we update it now it won't compile on stable,
and if we leave it as is it breaks CI on master).
amirh added a commit to flutter/plugins that referenced this issue May 28, 2019
…mple. (#1640)

This updates the sample to adapt to the ImageStream listener API changes
in flutter/flutter#32936

As we cannot use the new API before it makes it to stable I'm commenting
out the sample for now(if we update it now it won't compile on stable,
and if we leave it as is it breaks CI on master).
amirh added a commit to flutter/plugins that referenced this issue May 28, 2019
This updates the sample to adapt to the ImageStream listener API changes
in flutter/flutter#32936

This is similar to the change we did to Google Maps in #1640, unfortunately in the firebase_ml_vision case where we commented out the sample that used the ImageStream listener API. Unfortunately in the firebase_ml_vision case, there's no point in the sample without the ImageStream listener(you need it to pick an image), so I'm just updating the sample to the new API knowing that it won't compile on stable until the breaking change makes it there.
Kiku-Reise pushed a commit to Kiku-Reise/flutter that referenced this issue Jun 14, 2019
The current API was broken in that you registered multiple
callbacks at once, but when you removed listeners, only the
primary listener was used to determine what was removed.
This led to unintuitive cases where the caller could get
unexpected behavior.

This updates the API to add and remove listeners using
a newly introduced [ImageStreamListener] object, a value
object that has references to the individual callbacks
that may fire.

flutter#24722
flutter#32374
flutter#32935
DavBfr added a commit to DavBfr/dart_pdf that referenced this issue Jun 15, 2019
DavBfr added a commit to DavBfr/dart_pdf that referenced this issue Jun 15, 2019
collinjackson pushed a commit to collinjackson/flutterfire-old2 that referenced this issue Jun 24, 2019
This updates the sample to adapt to the ImageStream listener API changes
in flutter/flutter#32936

This is similar to the change we did to Google Maps in #1640, unfortunately in the firebase_ml_vision case where we commented out the sample that used the ImageStream listener API. Unfortunately in the firebase_ml_vision case, there's no point in the sample without the ImageStream listener(you need it to pick an image), so I'm just updating the sample to the new API knowing that it won't compile on stable until the breaking change makes it there.
DavBfr added a commit to DavBfr/dart_pdf that referenced this issue Jul 11, 2019
collinjackson pushed a commit to FirebaseExtended/flutterfire that referenced this issue Aug 14, 2019
This updates the sample to adapt to the ImageStream listener API changes
in flutter/flutter#32936

This is similar to the change we did to Google Maps in #1640, unfortunately in the firebase_ml_vision case where we commented out the sample that used the ImageStream listener API. Unfortunately in the firebase_ml_vision case, there's no point in the sample without the ImageStream listener(you need it to pick an image), so I'm just updating the sample to the new API knowing that it won't compile on stable until the breaking change makes it there.
@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.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants