Closed itsMatoosh closed 1 year ago
Thank you reporting it. We are going to take a look at it. 👌
Can you provide more details on how you use CameraAwesomeBuilder ? I have difficulties reproducing the problem. An example would help 👌
This is the builder I'm using. I have a custom layout widget CameraOverlay
with simple buttons for flash mode and camera sensor switching.
CameraAwesomeBuilder.custom(
initialCaptureMode: CaptureModes.PHOTO,
availableModes: const [
CaptureModes.PHOTO,
],
picturePathBuilder: (captureMode) => _path(captureMode),
videoPathBuilder: (captureMode) => _path(captureMode),
builder: (cameraModeState) => CameraOverlay(
cameraState: cameraModeState,
),
progressIndicator: const Center(
child: Icon(
Ionicons.camera,
size: 50,
),
),
exifPreferences: ExifPreferences(saveGPSLocation: false),
),
When the CameraAwesomeBuilder
widget is disposed (ex. when the camera page is closed), the camera session stays on as indicated by the green dot in the status bar on Android.
It looks like an issue with the internal start/stop state management within the package. The state isn't correctly set as started when a camera session begins and therefore the close method doesn't run. I created a quick fix for this issue in my fork: https://github.com/itsMatoosh/camera_awesome. Please take a look.
This was fixed in the latest commits, thanks!
When the
CameraAwesomeBuilder
widget is disposed, the underlying camera session is not being closed. This causes performance issues in the app after using the camera. I am using version 1.0.0 from the master branch.