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
513 stars 65 forks source link

Remove dependency on "image" package. #18

Closed deakjahn closed 4 years ago

deakjahn commented 4 years ago

As we discussed it with Rene at https://github.com/Baseflow/flutter_cached_network_image/issues/386, there is no need to depend on image for the conversion of pixel data to image, the Skia inside the Flutter framework can do it directly. These are the necessary changes. It works on mobile, I still have some problems on Flutter Web (it looks like ui.decodeImageFromPixels() simply never returns), so expect more to come.

Sorry for the inclusion of class Style, I don't know how Android Studio pulled that off. I simply forked, modified, committed and pushed. :-)

deakjahn commented 4 years ago

Fixed that pesky Style.

Solido commented 4 years ago

Thanks for the clarification of code !

deakjahn commented 4 years ago

I found this one: https://github.com/flutter/flutter/issues/45190. Bummer. This is the reason why it doesn't work on the web.

renefloor commented 4 years ago

@deakjahn does it mean it now doesn't work anymore on web? That doesn't really sound like an improvement.

Edit: I just saw you other PR (#13)

deakjahn commented 4 years ago

Yes, it was a setback because I only realized after having been modified that there is a problem with the web. Well, the workaround is just as fast as the original one now, and can be removed in the future (although actually it doesn't hurt anything but elegance to keep it there longer).

(I do depend on that Skia call in other parts of my application, so, well, that's life for you.)