fluttercommunity / flutter_blurhash

Compact representation of a placeholder for an image. Encode a blurry image under 30 caracters for instant display like used by Medium. Maintainer: @Solido
https://pub.dev/packages/flutter_blurhash
MIT License
528 stars 66 forks source link

Bad state: Cannot clone a disposed image #40

Open Kevin301099 opened 2 years ago

Kevin301099 commented 2 years ago

The clone() method of a previously-disposed Image was called. Once an Image object has been disposed, it can no longer be used to create handles, as the underlying data may have been released.

Navigate new screen and back to blur hash screen, I am getting this error

YDA93 commented 2 years ago

The clone() method of a previously-disposed Image was called. Once an Image object has been disposed, it can no longer be used to create handles, as the underlying data may have been released.

Navigate new screen and back to blur hash screen, I am getting this error

Have you found any workaround?

felipecastrosales commented 1 year ago

After installing and applying the flutter_blurhash package, I started encountering this error frequently in my console.

I believe this issue might be related to the usage of Slivers or widget rebuildings.

Any news about this?

felipecastrosales commented 1 year ago

Any expectation about this? @Solido

felipecastrosales commented 1 year ago

Hey folks, I created a minimal reproducible example for this, check the video below with an easy way to reproduce this:

https://github.com/felipecastrosales/bad_state_poc/assets/59374587/dc2f5316-8d3d-4aa4-8930-2b484ff00f5d

For more details and to see the code example above:

kienvtqhi commented 9 months ago

Use BlurHashImage instead of. It worked for me

Before: BlurHash(hash: userProfile.mainPhotoBlurhash)

After: Image( image: BlurHashImage(userProfile.mainPhotoBlurhash), fit: BoxFit.cover, )

felipecastrosales commented 9 months ago

@kienvtqhi can you add evidence in video here?

Use BlurHashImage instead of. It worked for me

Before: BlurHash(hash: userProfile.mainPhotoBlurhash)

After: Image( image: BlurHashImage(userProfile.mainPhotoBlurhash), fit: BoxFit.cover, )