josxha / flutter_map_plugins

The source code for all sorts of flutter_map plugins.
https://pub.dev/publishers/joscha-eckert.de/packages
29 stars 21 forks source link

🐛 fix(fm-cache): assertion error in `ImageProvider` if total bytes are unknown in `onReceiveProgress` callback. #37

Closed Thelm76 closed 8 months ago

Thelm76 commented 8 months ago

This PR adds filters in the CachedImageProvider in order to avoid the assertion errors throwed by the ImageChunkEvent

fyi : when the total response size is unknown by the Dio while executing a get method, the total parameter passed through the onReceivedProgress callback is -1, whereas ImageChunkEvent expects null in that case.

josxha commented 8 months ago

Thanks for the pull request!