removed focus & exposure fix

This commit is contained in:
Vadim 2024-04-06 18:48:29 +02:00
parent 1712e92aef
commit 46e2c8342f

View file

@ -217,15 +217,9 @@ 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 bytes = await file.readAsBytes(); final bytes = await file.readAsBytes();
Directory(file.path).deleteSync(recursive: true); Directory(file.path).deleteSync(recursive: true);
return await evFromImage(bytes); return await evFromImage(bytes);
} catch (e, stackTrace) { } catch (e, stackTrace) {
_analytics.logCrash(e, stackTrace); _analytics.logCrash(e, stackTrace);