pickMultiFromGallery method

Future<List<AttachmentResult>> pickMultiFromGallery({
  1. int? maxCount,
})

Picks multiple images from the device gallery.

Returns a list of AttachmentResult objects.

Implementation

Future<List<AttachmentResult>> pickMultiFromGallery({int? maxCount}) async {
  try {
    final List? results = await _channel.invokeMethod('pickMultiImage', {
      'maxCount': maxCount,
    });
    if (results == null) return [];
    var attachmentResults = results.map((e) => _resultFromPath(e.toString())).toList();
    return attachmentResults;
  } catch (e) {
    debugPrint('PixelToPdfService: pickMultiImage error: $e');
    return [];
  }
}