vintage / scratcher

Scratch card widget which temporarily hides content from user.
https://pub.dev/packages/scratcher
MIT License
572 stars 67 forks source link

Error while loading image #15

Closed KumarSunil17 closed 4 years ago

KumarSunil17 commented 4 years ago

Error while using image:

type '(Uint8List, {int cacheHeight, int cacheWidth}) => Future<Codec>' is not a subtype of type '(Uint8List, {bool allowUpscaling, int cacheHeight, int cacheWidth}) => Future<Codec>' of 'decode'

Solution Try replacing

imageProvider.load(key, (Uint8List bytes,
          {int cacheWidth, int cacheHeight}) async {
        return await ui.instantiateImageCodec(bytes);
      })
        ..addListener(ImageStreamListener((ImageInfo image, _) {
          completer.complete(image.image);
        }));

with

imageProvider.load(key, (Uint8List bytes,
          {int cacheWidth, int cacheHeight, bool allowUpscaling}) async {
        return await ui.instantiateImageCodec(bytes);
      })
        ..addListener(ImageStreamListener((ImageInfo image, _) {
          completer.complete(image.image);
        }));
vintage commented 4 years ago

Thanks @KumarSunil17! The image cover is fixed in the 1.4.0 release https://pub.dev/packages/scratcher