isDecodedImageCacheHit function

bool isDecodedImageCacheHit(
  1. ImageCacheStatus status
)

Whether status is a decoded Flutter ImageCache hit (image.source=memory).

In-flight loads are ImageCacheStatus.pending and also ImageCacheStatus.live, so keepAlive || live is not enough — a second widget joining a download would be mislabeled as a memory hit.

Implementation

bool isDecodedImageCacheHit(ImageCacheStatus status) =>
    !status.pending && (status.keepAlive || status.live);