Skip to content

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 23:04
@Hixie
Copy link
Contributor

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.

@Piinks Piinks added a: images Loading, displaying, rendering images framework flutter/packages/flutter repository. See also f: labels. labels May 17, 2019
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

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.

#24722
#32374
#32935
@tvolkert tvolkert merged commit 592f81e into flutter:master May 21, 2019
@tvolkert tvolkert deleted the listeners branch May 21, 2019 00:40
mollywoodnini added a commit to mollywoodnini/flutter_plugin_pdf_viewer that referenced this pull request 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 pull request May 28, 2019
amirh added a commit to amirh/plugins that referenced this pull request 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 amirh/plugins that referenced this pull request 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 pull request 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 pull request 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.
DavBfr added a commit to DavBfr/dart_pdf that referenced this pull request Jun 15, 2019
DavBfr added a commit to DavBfr/dart_pdf that referenced this pull request Jun 15, 2019
collinjackson pushed a commit to collinjackson/flutterfire-old2 that referenced this pull request 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 pull request Jul 11, 2019
collinjackson pushed a commit to firebase/flutterfire that referenced this pull request 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.

Labels

a: images Loading, displaying, rendering images framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants