pickMultiImage method
Returns a List<PickedFile>
with the images that were picked.
The images come from the ImageSource.gallery
.
Where iOS supports HEIC images, Android 8 and below doesn't. Android 9 and above only support HEIC images if used in addition to a size modification, of which the usage is explained below.
If specified, the image will be at most maxWidth
wide and
maxHeight
tall. Otherwise the image will be returned at it's
original width and height.
The imageQuality
argument modifies the quality of the images, ranging from 0-100
where 100 is the original/max quality. If imageQuality
is null, the images with
the original quality will be returned. Compression is only supported for certain
image types such as JPEG. If compression is not supported for the image that is picked,
a warning message will be logged.
If no images were picked, the return value is null.
Implementation
@override
Future<List<PickedFile>?> pickMultiImage({
double? maxWidth,
double? maxHeight,
int? imageQuality,
}) async {
final List<dynamic> paths = await _pickMultiImageAsPath(
options: MultiImagePickerOptions(
imageOptions: ImageOptions(
maxWidth: maxWidth,
maxHeight: maxHeight,
imageQuality: imageQuality,
),
),
);
// Convert an empty list to a null return since that was the legacy behavior
// of this method.
if (paths.isEmpty) {
return null;
}
return paths.map((dynamic path) => PickedFile(path as String)).toList();
}