pick static method

Future<List<CloudMediaItem>> pick({
  1. CloudMediaType type = CloudMediaType.image,
  2. int maxCount = 1,
  3. bool enableEditing = true,
  4. bool enableBackgroundRemoval = false,
})

Pick one or more media files from the device.

Returns a List<CloudMediaItem>. Each item is immediately available with a localPath while the upload queues in the background.

Parameters:

  • type — the type of media to pick (default: CloudMediaType.image)
  • maxCount — maximum number of files (default: 1, max: 100)
  • enableEditing — show crop/rotate editor after picking
  • enableBackgroundRemoval — show background removal screen
// Single image
final items = await CloudMedia.pick();

// Multiple images
final items = await CloudMedia.pick(maxCount: 10);

// With background removal
final items = await CloudMedia.pick(enableBackgroundRemoval: true);

Throws CloudMediaPermissionDeniedException if permission is denied. Throws CloudMediaFileTooLargeException if a file exceeds the size limit. Throws CloudMediaUnsupportedFileTypeException for unsupported formats.

Implementation

static Future<List<CloudMediaItem>> pick({
  CloudMediaType type = CloudMediaType.image,
  int maxCount = 1,
  bool enableEditing = true,
  bool enableBackgroundRemoval = false,
}) async {
  _ensure();
  return _provider!.pickMedia(
    type: type,
    maxCount: maxCount,
    enableEditing: enableEditing,
    enableBackgroundRemoval: enableBackgroundRemoval,
  );
}