pickVideo static method

Future<XFile?> pickVideo({
  1. required ImageSource source,
  2. CameraDevice preferredCameraDevice = CameraDevice.rear,
  3. Duration? maxDuration,
})

Implementation

static Future<XFile?> pickVideo({
  required ImageSource source,
  CameraDevice preferredCameraDevice = CameraDevice.rear,
  Duration? maxDuration,
}) async {
  try {
    final ImagePicker picker = ImagePicker();
    final XFile? video = await picker.pickVideo(
      source: source,
      preferredCameraDevice: preferredCameraDevice,
      maxDuration: maxDuration,
    );
    return video;
  } catch (e) {
    LoggerService.logError('Utils pickVideo: could not pick video: $e');
  }
  return null;
}