Apparence-io / CamerAwesome

πŸ“Έ Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.
https://ApparenceKit.dev
MIT License
958 stars 245 forks source link

πŸ’₯ Sensors API breaking changes #310

Closed apalala-dev closed 1 year ago

apalala-dev commented 1 year ago

Description

SensorConfig already contained:

Now it has single and multiple constructors to set one or multiple sensors. The parameters that SensorConfig already contain have been removed from 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.

Checklist

Before creating any Pull Request, confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).

Breaking Change

CameraAwesomeBuilder now takes a SensorConfig instead of the several parameters it already has.