pskink / matrix_gesture_detector

A gesture detector mapping translation/rotation/scale gestures to a Matrix4 object.
Other
134 stars 101 forks source link

Update examples to fix a problem related to a breaking change in Flutter plugins #10

Closed ChristianEdwardPadilla closed 4 years ago

ChristianEdwardPadilla commented 4 years ago

Update examples to fix a problem related to a breaking Flutter plugins (see: https://github.com/flutter/flutter/issues/27226) and a breaking change to ImageStream listener API.

pskink commented 4 years ago

Christian,

thanks a lot, so i should simply press "merge pull request" button and everything is done?

also, how it works:

oldImageStream?.removeListener(ImageStreamListener(imageLoaded));

if you are creating a new ImageStreamListener so how it can be removed from oldImageStream?

btw now i would simply use decodeImageFromList function instead of that ImageProvider stuff (a year ago i was not aware of it)

pskink

On Mon, Mar 23, 2020 at 7:51 AM Christian Padilla notifications@github.com wrote:

Update examples to fix a problem related to a breaking Flutter plugins (see: flutter/flutter#27226 https://github.com/flutter/flutter/issues/27226) and a breaking change to ImageStream listener API.

You can view, comment on, or merge this pull request online at:

https://github.com/pskink/matrix_gesture_detector/pull/10 Commit Summary

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pskink/matrix_gesture_detector/pull/10, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPVCG7PHVMVWHJI6HGZTLRI4BIJANCNFSM4LRUJ4CA .

ChristianEdwardPadilla commented 4 years ago

You should be able to merge it with that button, yes.

Taking a look at ImageStreamListener, the docs have this to say about instances and equality:

/// This class overrides [operator ==] and [hashCode] to compare the individual
/// callbacks in the listener, meaning that if you add an instance of this class
/// as a listener (e.g. via [ImageStream.addListener]), you can instantiate a
/// _different_ instance of this class when you remove the listener, and the
/// listener will be properly removed as long as all associated callbacks are
/// equal.

(source: https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/painting/image_stream.dart) (docs: https://api.flutter.dev/flutter/painting/ImageStreamListener-class.html)

ChristianEdwardPadilla commented 4 years ago

This is an awesome widget by the way! Great work :)

pskink commented 4 years ago

that makes sense, thanks for explanation, I must be blind ...

On Mon, Mar 23, 2020, 20:08 Christian Padilla notifications@github.com wrote:

You should be able to merge it with that button, yes.

Taking a look at ImageStreamListener, the docs have this to say about instances and equality:

/// This class overrides [operator ==] and [hashCode] to compare the individual /// callbacks in the listener, meaning that if you add an instance of this class /// as a listener (e.g. via [ImageStream.addListener]), you can instantiate a /// different instance of this class when you remove the listener, and the /// listener will be properly removed as long as all associated callbacks are /// equal.

(source: https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/painting/image_stream.dart ) (docs: https://api.flutter.dev/flutter/painting/ImageStreamListener-class.html)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pskink/matrix_gesture_detector/pull/10#issuecomment-602799248, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPVCG3MGLTJFLN7PMXNNDRI6XUBANCNFSM4LRUJ4CA .

pskink commented 4 years ago

thanks, I already merged your two pull requests

On Mon, Mar 23, 2020, 20:09 Christian Padilla notifications@github.com wrote:

This is an awesome widget by the way! Great work :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pskink/matrix_gesture_detector/pull/10#issuecomment-602799703, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPVCEWYAPHDZV75GF5C5TRI6XXPANCNFSM4LRUJ4CA .