Compare commits

...

2 commits

Author SHA1 Message Date
vodemn
6e1aaf5acf Version bump 2023-08-03 20:54:33 +00:00
Vadim
c12cfb1697 Lock & release focus when taking a picture 2023-08-03 22:46:01 +02:00
2 changed files with 7 additions and 2 deletions

View file

@ -129,7 +129,6 @@ class CameraContainerBloc extends EvSourceBlocBase<CameraContainerEvent, CameraC
await _cameraController!.initialize(); await _cameraController!.initialize();
await _cameraController!.setFlashMode(FlashMode.off); await _cameraController!.setFlashMode(FlashMode.off);
await _cameraController!.setFocusMode(FocusMode.locked);
_zoomRange = await Future.wait<double>([ _zoomRange = await Future.wait<double>([
_cameraController!.getMinZoomLevel(), _cameraController!.getMinZoomLevel(),
@ -206,7 +205,13 @@ class CameraContainerBloc extends EvSourceBlocBase<CameraContainerEvent, CameraC
Future<double?> _takePhoto() async { Future<double?> _takePhoto() async {
try { try {
// https://github.com/flutter/flutter/issues/84957#issuecomment-1661155095
await _cameraController!.setFocusMode(FocusMode.locked);
await _cameraController!.setExposureMode(ExposureMode.locked);
final file = await _cameraController!.takePicture(); final file = await _cameraController!.takePicture();
await _cameraController!.setFocusMode(FocusMode.auto);
await _cameraController!.setExposureMode(ExposureMode.auto);
final Uint8List bytes = await file.readAsBytes(); final Uint8List bytes = await file.readAsBytes();
Directory(file.path).deleteSync(recursive: true); Directory(file.path).deleteSync(recursive: true);

View file

@ -1,7 +1,7 @@
name: lightmeter name: lightmeter
description: A new Flutter project. description: A new Flutter project.
publish_to: "none" publish_to: "none"
version: 0.12.3+34 version: 0.12.4+35
environment: environment:
sdk: ">=3.0.0 <4.0.0" sdk: ">=3.0.0 <4.0.0"