start method

Future<void> start()

Implementation

Future<void> start() async {
  final filter = cameraContext.filterController.valueOrNull;
  if (filter != null) {
    await setFilter(filter);
  }
  switch (nextCaptureMode) {
    case CaptureMode.photo:
      await _startPhotoMode();
      break;
    case CaptureMode.video:
      await _startVideoMode();
      break;
    case CaptureMode.preview:
      await _startPreviewMode();
      break;
    case CaptureMode.analysis_only:
      await _startAnalysisMode();
      break;
  }
  await cameraContext.analysisController?.setup();
  if (nextCaptureMode == CaptureMode.analysis_only) {
    // Analysis controller needs to be setup before going to AnalysisCameraState
    cameraContext.changeState(AnalysisCameraState.from(cameraContext));
  }

  if (cameraContext.enablePhysicalButton) {
    initPhysicalButton();
  }
}