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

Fix for Flutter 1.6.3 #147

Merged
merged 2 commits into from
May 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/photo_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ class _PhotoViewState extends State<PhotoView>
final Completer completer = Completer<ImageInfo>();
final ImageStream stream =
widget.imageProvider.resolve(const ImageConfiguration());
final listener = (ImageInfo info, bool synchronousCall) {
final listener = ImageStreamListener((ImageInfo info, bool synchronousCall) {
if (!completer.isCompleted) {
completer.complete(info);
if (mounted) {
Expand All @@ -376,10 +376,10 @@ class _PhotoViewState extends State<PhotoView>
});
}
}
};
stream.addListener(ImageStreamListener(listener));
});
stream.addListener(listener);
completer.future.then((_) {
stream.removeListener(ImageStreamListener(listener));
stream.removeListener(listener);
});
return completer.future;
}
Expand Down