pickImage static method
Implementation
static Future<File?> pickImage(ImageSource imageSource) async {
final ImagePicker picker = ImagePicker();
final XFile? image = await picker.pickImage(
source: imageSource,
maxWidth: 400,
maxHeight: 400,
);
if (image != null) {
return File(image.path);
}
return null;
}