SensorConfig constructor
SensorConfig({})
Implementation
SensorConfig({
required this.sensor,
FlashMode flash = FlashMode.none,
bool mirrorFrontCamera = false,
SensorType type = SensorType.wideAngle,
this.captureDeviceId,
CameraAspectRatios aspectRatio = CameraAspectRatios.ratio_4_3,
/// Zoom must be between 0.0 (no zoom) and 1.0 (max zoom)
double currentZoom = 0.0,
}) {
_flashModeController = BehaviorSubject<FlashMode>.seeded(flash);
flashMode$ = _flashModeController.stream;
_mirrorFrontCameraController =
BehaviorSubject<bool>.seeded(mirrorFrontCamera);
mirrorFrontCamera$ = _mirrorFrontCameraController.stream;
_sensorTypeController = BehaviorSubject<SensorType>.seeded(type);
sensorType$ = _sensorTypeController.stream;
_zoomController = BehaviorSubject<double>.seeded(currentZoom);
zoom$ = _zoomController.stream;
_aspectRatioController = BehaviorSubject.seeded(aspectRatio);
aspectRatio$ = _aspectRatioController.stream;
_brightnessSubscription = _brightnessController.stream
.debounceTime(const Duration(milliseconds: 500))
.listen((value) => CamerawesomePlugin.setBrightness(value));
}