when method
dynamic
when({
- OnVideoMode? onVideoMode,
- OnPhotoMode? onPhotoMode,
- OnPreparingCamera? onPreparingCamera,
- OnVideoRecordingMode? onVideoRecordingMode,
- OnPreviewMode? onPreviewMode,
- OnAnalysisOnlyMode? onAnalysisOnlyMode,
Implementation
when({
OnVideoMode? onVideoMode,
OnPhotoMode? onPhotoMode,
OnPreparingCamera? onPreparingCamera,
OnVideoRecordingMode? onVideoRecordingMode,
OnPreviewMode? onPreviewMode,
OnAnalysisOnlyMode? onAnalysisOnlyMode,
}) {
if (this is VideoCameraState && onVideoMode != null) {
return onVideoMode(this as VideoCameraState);
}
if (this is PhotoCameraState && onPhotoMode != null) {
return onPhotoMode(this as PhotoCameraState);
}
if (this is PreparingCameraState && onPreparingCamera != null) {
return onPreparingCamera(this as PreparingCameraState);
}
if (this is VideoRecordingCameraState && onVideoRecordingMode != null) {
return onVideoRecordingMode(this as VideoRecordingCameraState);
}
if (this is PreviewCameraState && onPreviewMode != null) {
return onPreviewMode(this as PreviewCameraState);
}
if (this is AnalysisCameraState && onAnalysisOnlyMode != null) {
return onAnalysisOnlyMode(this as AnalysisCameraState);
}
}