pickImage static method
Future<XFile?>
pickImage(
{ - required ImageSource source,
- double? maxWidth,
- double? maxHeight,
- int? imageQuality,
- CameraDevice preferredCameraDevice = CameraDevice.rear,
- bool requestFullMetadata = true,
})
Implementation
static Future<XFile?> pickImage({
required ImageSource source,
double? maxWidth,
double? maxHeight,
int? imageQuality,
CameraDevice preferredCameraDevice = CameraDevice.rear,
bool requestFullMetadata = true,
}) async {
try {
final ImagePicker picker = ImagePicker();
final XFile? image = await picker.pickImage(
source: source,
maxWidth: maxWidth,
maxHeight: maxHeight,
imageQuality: imageQuality,
preferredCameraDevice: preferredCameraDevice,
requestFullMetadata: requestFullMetadata,
);
return image;
} catch (e) {
LoggerService.logError('Utils pickImage: could not pick image: $e');
}
return null;
}