CameraPicker constructor
CameraPicker({
- Key? key,
- bool enableRecording = false,
- bool onlyEnableRecording = false,
- bool enableTapRecording = false,
- bool enableAudio = true,
- bool enableSetExposure = true,
- bool enableExposureControlOnPoint = true,
- bool enablePinchToZoom = true,
- bool enablePullToZoomInRecord = true,
- bool shouldDeletePreviewFile = false,
- bool shouldAutoPreviewVideo = false,
- Duration? maximumRecordingDuration = const Duration(seconds: 15),
- ThemeData? theme,
- ResolutionPreset resolutionPreset = ResolutionPreset.max,
- ImageFormatGroup imageFormatGroup = ImageFormatGroup.unknown,
- CameraLensDirection preferredLensDirection = CameraLensDirection.back,
- int cameraQuarterTurns = 0,
- Widget foregroundBuilder()?,
- EntitySaveCallback? onEntitySaving,
- CameraErrorHandler? onError,
- CameraPickerTextDelegate? textDelegate,
Implementation
CameraPicker({
Key? key,
this.enableRecording = false,
this.onlyEnableRecording = false,
this.enableTapRecording = false,
this.enableAudio = true,
this.enableSetExposure = true,
this.enableExposureControlOnPoint = true,
this.enablePinchToZoom = true,
this.enablePullToZoomInRecord = true,
this.shouldDeletePreviewFile = false,
this.shouldAutoPreviewVideo = false,
this.maximumRecordingDuration = const Duration(seconds: 15),
this.theme,
this.resolutionPreset = ResolutionPreset.max,
this.imageFormatGroup = ImageFormatGroup.unknown,
this.preferredLensDirection = CameraLensDirection.back,
this.cameraQuarterTurns = 0,
this.foregroundBuilder,
this.onEntitySaving,
this.onError,
CameraPickerTextDelegate? textDelegate,
}) : assert(
enableRecording == true || onlyEnableRecording != true,
'Recording mode error.',
),
super(key: key) {
// Set text delegate accordingly.
if (textDelegate != null) {
Constants.textDelegate = textDelegate;
} else if (enableRecording && onlyEnableRecording && enableTapRecording) {
Constants.textDelegate =
DefaultCameraPickerTextDelegateWithTapRecording();
} else if (enableRecording && onlyEnableRecording) {
Constants.textDelegate =
DefaultCameraPickerTextDelegateWithOnlyRecording();
} else if (enableRecording) {
Constants.textDelegate = DefaultCameraPickerTextDelegateWithRecording();
} else {
Constants.textDelegate = DefaultCameraPickerTextDelegate();
}
}