efortuna / memechat

a meme-based chat application
542 stars 150 forks source link

in Main File addListener((_, __) can't be assigned to the parameter type 'ImageStreamListener' #38

Open rjzg85 opened 5 years ago

rjzg85 commented 5 years ago

There is an error in main.dart file in line 80, can't be assigned to the parameter type 'ImageStreamListener', I am using the latest version of Flutter and Dart.

would be nice if you can help me with the error, I tried to look answer on intenert and I couldnt find anything, I am new on this :(

Thanks in advance

skoocda commented 4 years ago

I got the following error message:

Error: The argument type 'Null Function(dynamic, dynamic)' can't be assigned to the parameter type 'ImageStreamListener'.

Because of this:

      image
          .resolve(createLocalImageConfiguration(context))
          .addListener((_, __) {
        animationController?.forward();
      });

fixed with:

      image
          .resolve(createLocalImageConfiguration(context))
          .addListener(
          ImageStreamListener((ImageInfo image, bool synchronousCall) {
        animationController?.forward();
      }));

Hope that helps!