pickImageFromGallery method

Future<List<File?>> pickImageFromGallery()

Implementation

Future<List<File?>> pickImageFromGallery() async {
  try {
    var image = await (_picker.pickMultiImage(imageQuality: 60));
    //log('image gotten');

    // ignore: unnecessary_null_comparison
    if (image != null && image.isNotEmpty) {
      List<File?> file = image.map((i) => File(i.path)).toList();
      // File(image.path);

      return file;
    } else {
      return [];
    }
  } catch (e) {
    //log(e.toString());
    return [];
  }
}