takePicture method

Future<XFile?> takePicture()

Implementation

Future<XFile?> takePicture() async {
  assert(_cameraController != null, 'Camera controller not initialized');
  await _cameraController?.stopImageStream();
  XFile? file = await _cameraController?.takePicture();
  final correctedImage = await fixImageOrientation(file);
  _imagePath.value = correctedImage.path;
  return XFile(correctedImage.path);
}