Skip to content

Commit

Permalink
[camera] Example app: refactoring setExposureOffset
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCsabaToth committed Aug 26, 2024
1 parent b9715b7 commit 7651257
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/camera/camera/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -949,11 +949,13 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
return;
}

setState(() {
_currentExposureOffset = offset;
});
try {
offset = await controller!.setExposureOffset(offset);
final appliedOffset = await controller!.setExposureOffset(offset);
if (appliedOffset != _currentExposureOffset) {
setState(() {
_currentExposureOffset = appliedOffset;
});
}
} on CameraException catch (e) {
_showCameraException(e);
rethrow;
Expand Down

0 comments on commit 7651257

Please sign in to comment.