getThumbhashProvider method
- ThumbHash thumbhash
Returns the ImageProvider for the provided thumbhash
.
Implementation
ImageProvider getThumbhashProvider(ThumbHash thumbhash) {
final ImageProvider thumbhashProvider =
_thumbhashProviders[thumbhash] ??
(_thumbhashProviders[thumbhash] =
t.ThumbHash.fromBase64(thumbhash.val).toImage());
if (_thumbhashProviders.length > 100) {
_thumbhashProviders.remove(_thumbhashProviders.keys.first);
}
return thumbhashProvider;
}