pariyatti / mobile-app

The Pariyatti mobile app
https://pariyatti.app/
GNU Affero General Public License v3.0
8 stars 11 forks source link

Codec: setState() called after dispose() #55

Open deobald opened 3 years ago

deobald commented 3 years ago

Does not affect the UI. However, when running the app, this appears in the console:

flutter: ══╡ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE ╞════════════════════════════════════════════════════
flutter: The following assertion was thrown resolving an image codec:
flutter: setState() called after dispose(): _OverlayInspirationCardState#1800b(lifecycle state: defunct, not
flutter: mounted)
flutter: This error happens if you call setState() on a State object for a widget that no longer appears in
flutter: the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error
flutter: can occur when code calls setState() from a timer or an animation callback.
flutter: The preferred solution is to cancel the timer or stop listening to the animation in the dispose()
flutter: callback. Another solution is to check the "mounted" property of this object before calling
flutter: setState() to ensure the object is still in the tree.
flutter: This error might indicate a memory leak if setState() is being called because another object is
flutter: retaining a reference to this State object after it has been removed from the tree. To avoid memory
flutter: leaks, consider breaking the reference to this object during dispose().
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0      State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1208:9)
flutter: #1      State.setState (package:flutter/src/widgets/framework.dart:1243:6)
flutter: #2      _OverlayInspirationCardState.build.<anonymous closure> (package:patta/ui/common_widgets/cards/OverlayInspirationCard.dart:108:25)
flutter: #3      CachedNetworkImageProvider._loadAsync (package:cached_network_image/src/image_provider/_image_provider_io.dart:128:19)
flutter: <asynchronous suspension>
flutter: #4      CachedNetworkImageProvider.load (package:cached_network_image/src/image_provider/_image_provider_io.dart:79:14)
flutter: #5      ImageProvider.resolveStreamForKey.<anonymous closure> (package:flutter/src/painting/image_provider.dart:504:13)
flutter: #6      ImageCache.putIfAbsent (package:flutter/src/painting/image_cache.dart:355:22)
flutter: #7      ImageProvider.resolveStreamForKey (package:flutter/src/painting/image_provider.dart:502:83)
flutter: #8      ScrollAwareImageProvider.resolveStreamForKey (package:flutter/src/widgets/scroll_aware_image_provider.dart:108:19)
flutter: #9      ImageProvider.resolve.<anonymous closure> (package:flutter/src/painting/image_provider.dart:333:9)