showPicker method
Future<File>
showPicker({
- required SourceType source,
- double? width,
- double? height,
- int? imageQuality,
override
Implementation
@override
Future<File> showPicker(
{required SourceType source,
double? width,
double? height,
int? imageQuality}) async {
Map<String, dynamic> args = {
'source': source.name,
'width': width,
'height': height,
'imageQuality': imageQuality
};
CameraDevice? preferredCameraDevice;
if (source == SourceType.front) {
preferredCameraDevice = CameraDevice.front;
} else if (source == SourceType.back) {
preferredCameraDevice = CameraDevice.rear;
}
String? result;
if (Platform.isAndroid) {
result = await _pickerService.pickImageFromCamera(
width: width,
height: height,
imageQuality: imageQuality,
preferredCameraDevice: preferredCameraDevice);
} else if (Platform.isIOS) {
result = await methodChannel.invokeMethod('showPicker', args);
}
return File(result!);
}