pickImages static method

Future<List<File>> pickImages()

Picks multiple images from the device using the ImagePicker package.

Returns a list of File objects representing the selected images. Returns an empty list if no images are selected or an error occurs.

Implementation

static Future<List<File>> pickImages() async {
  try {
    final ImagePicker picker = ImagePicker();
    final List<XFile> images = await picker.pickMultiImage();

    return images.map((xfile) => File(xfile.path)).toList();
      } catch (e) {
    debugPrint("Error picking images: $e");
  }
  return [];
}