getOverrideThumbnailFromMediaItem method

ImageProvider<Object>? getOverrideThumbnailFromMediaItem(
  1. {required AppModel appModel,
  2. required MediaItem item}
)

Given a MediaItem, return its override display thumbnail.

Implementation

ImageProvider<Object>? getOverrideThumbnailFromMediaItem({
  required AppModel appModel,
  required MediaItem item,
}) {
  String filename = getOverrideThumbnailFilename(
    appModel: appModel,
    item: item,
  );

  File file = File(filename);
  if (!file.existsSync()) {
    return null;
  }

  return FileImage(file);
}