toCameraState method

CameraState toCameraState(
  1. CameraContext cameraContext
)

Implementation

CameraState toCameraState(CameraContext cameraContext) {
  if (this == CaptureMode.photo) {
    return PhotoCameraState.from(cameraContext);
  } else if (this == CaptureMode.video) {
    return VideoCameraState.from(cameraContext);
  } else if (this == CaptureMode.preview) {
    return PreviewCameraState(cameraContext: cameraContext);
  } else if (this == CaptureMode.analysis_only) {
    return PreviewCameraState(cameraContext: cameraContext);
  }
  throw "State not recognized";
}