Closed apalala-dev closed 1 year ago
SensorConfig already contained:
SensorConfig
Now it has single and multiple constructors to set one or multiple sensors. The parameters that SensorConfig already contain have been removed from CameraAwesomeBuilder.
single
multiple
CameraAwesomeBuilder
Now, one could use CamerAwesome like this:
CameraAwesomeBuilder.awesome( saveConfig: SaveConfig.photoAndVideo( photoPathBuilder: () => path(CaptureMode.photo), videoPathBuilder: () => path(CaptureMode.video), initialCaptureMode: CaptureMode.video, ), sensorConfig: SensorConfig.single( sensor: Sensor.position(SensorPosition.back), flashMode: FlashMode.auto, zoom: 0.5, aspectRatio: CameraAspectRatios.ratio_1_1, mirrorFrontCamera: true, ), )
Or even:
CameraAwesomeBuilder.awesome( saveConfig: SaveConfig.photoAndVideo( photoPathBuilder: () => path(CaptureMode.photo), videoPathBuilder: () => path(CaptureMode.video), initialCaptureMode: CaptureMode.video, ), );
In this case, the default configuration is used (back sensor, no flash, no zoom, aspect ratio 4:3, mirroFrontCamera = false).
Notes:
Next step: make SaveConfig compatible with web and multi camera.
SaveConfig
Before creating any Pull Request, confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
[x]
flutter analyze
CameraAwesomeBuilder now takes a SensorConfig instead of the several parameters it already has.
Description
SensorConfig
already contained:Now it has
single
andmultiple
constructors to set one or multiple sensors. The parameters thatSensorConfig
already contain have been removed fromCameraAwesomeBuilder
.Now, one could use CamerAwesome like this:
Or even:
In this case, the default configuration is used (back sensor, no flash, no zoom, aspect ratio 4:3, mirroFrontCamera = false).
Notes:
SensorConfig
(e.g.: flash) call native code to make the change.SensorConfig
is not the currently usedSensorConfig
, it might have unpredictable behaviour.SensorConfig
builder don't actually call native code since the camera might not have been setup yet.Next step: make
SaveConfig
compatible with web and multi camera.Checklist
Before creating any Pull Request, confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
).flutter analyze
without any issues.Breaking Change
CameraAwesomeBuilder
now takes aSensorConfig
instead of the several parameters it already has.