From 1e5225dcf108c66c7ad7e83cf78981bcd7e3320e Mon Sep 17 00:00:00 2001 From: chonghorizons <36284839+chonghorizons@users.noreply.github.com> Date: Thu, 9 Apr 2020 09:31:01 -0400 Subject: [PATCH] Set the type of the callback passed to AddLIstener Fix for issue #38 https://github.com/efortuna/memechat/issues/38 --- lib/main.dart | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 962d262..077f552 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -115,11 +115,18 @@ class ChatScreenState extends State with TickerProviderStateMixin { }); if (imageUrl != null) { NetworkImage image = NetworkImage(imageUrl); - image - .resolve(createLocalImageConfiguration(context)) - .addListener((_, __) { + ImageStreamListener isl = ImageStreamListener((_, __) { animationController?.forward(); }); + image + .resolve(createLocalImageConfiguration(context)) + .addListener(isl); +// OLD CODE WITH typeCheck error "Null(dynamic, dynamic) +// image +// .resolve(createLocalImageConfiguration(context)) +// .addListener((_, __) { +// animationController?.forward(); +// }); } else { animationController?.forward(); }