cacheImagePath method

String? cacheImagePath({
  1. required int id,
  2. required String type,
  3. String mediaType = 'image/png',
})

Cache the image path immediately (fast, no file I/O).

Implementation

String? cacheImagePath({
  required int id,
  required String type,
  String mediaType = 'image/png',
}) {
  if (type != 'image') return null;
  final imagePath = _getImagePath(id, mediaType);
  _evictOldestIfAtCap();
  _storedImagePaths[id] = imagePath;
  return imagePath;
}