I think this package is no longer compatable with the latest stable build of flutter due to the errors below. Flutter version is Flutter (Channel stable, v1.7.8+hotfix.3, on Mac OS X 10.15 19A512f, locale en-GB)
Compiler message:
lib/scalable_image.dart:60:38: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
- 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/user/flutter/packages/flutter/lib/src/painting/image_stream.dart').
- 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/user/flutter/packages/flutter/lib/src/painting/image_stream.dart').
Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
oldImageStream?.removeListener(_updateImage);
^
lib/scalable_image.dart:61:32: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
- 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/user/flutter/packages/flutter/lib/src/painting/image_stream.dart').
- 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/user/flutter/packages/flutter/lib/src/painting/image_stream.dart').
Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
_imageStream.addListener(_updateImage);
^
lib/scalable_image.dart:74:33: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
- 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/user/flutter/packages/flutter/lib/src/painting/image_stream.dart').
- 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/user/flutter/packages/flutter/lib/src/painting/image_stream.dart').
Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
_imageStream.removeListener(_updateImage);
I have tried changing the return type of _updateImage
to ImageStreamListener, but it seems this then does not expect parameters to be passed to it. Using removeListener(_updateImage as ImageStreamListener);
seems to suppress errors, but the no images display.
Unfortunately, I don't know enough about the inner workings of flutter to fix this myself, but happy to give it a go if you can point me in the right direction.