pickImage static method

Future<File?> pickImage()

Implementation

static Future<File?> pickImage() async {
  try {
    final image = await ImagePicker().pickImage(source: ImageSource.gallery);
    if (image == null) return null;
    final imageTemp = File(image.path);
    Logs.debug(image.name);
    return imageTemp;
  } on PlatformException catch (e) {
    Logs.debug('Failed to pick image: $e');
  }
  return null;
}