generateMediaItem method

MediaItem generateMediaItem(
  1. {required String title,
  2. required String imageUrl,
  3. required String url,
  4. required int pageCount}
)

Generate a media item given required parameters.

Implementation

MediaItem generateMediaItem({
  required String title,
  required String imageUrl,
  required String url,
  required int pageCount,
}) {
  return MediaItem(
    mediaIdentifier: url,
    imageUrl: imageUrl,
    title: title,
    position: 0,
    duration: pageCount,
    mediaTypeIdentifier: mediaType.uniqueKey,
    mediaSourceIdentifier: uniqueKey,
    canDelete: true,
    canEdit: true,
  );
}