findImagesInAlbum method

Future<List<LocalImage>> findImagesInAlbum(
  1. String albumId,
  2. int maxImages
)

Returns the images contained in the given album on the local device up to maxImages in length.

This list may be empty if there are no images in the album or the user has denied permission to see their local images. If there are more images in the album than maxImages the list is silently truncated. Note that images are quite small and fast to load since they don't load the image contents just basic metadata, so it is usually safe to load a large number of images from an album if required.

Implementation

Future<List<LocalImage>> findImagesInAlbum(
    String albumId, int maxImages) async {
  if (!_initWorked) {
    throw LocalImageProviderNotInitializedException();
  }
  final List<dynamic> images = await LocalImageProviderPlatform.instance
      .findImagesInAlbum(albumId, maxImages);
  return _jsonToLocalImages(images);
}