@@ -573,8 +573,9 @@ class CameraPickerState extends State<CameraPicker>
573
573
574
574
/// Use the [details] point to set exposure and focus.
575
575
/// 通过点击点的 [details] 设置曝光和对焦。
576
- void setExposureAndFocusPoint (TapUpDetails details) {
576
+ Future < void > setExposureAndFocusPoint (TapUpDetails details) async {
577
577
assert (controller != null );
578
+ _isExposureModeDisplays.value = false ;
578
579
// Ignore point update when the new point is less than 8% and higher than
579
580
// 92% of the screen's height.
580
581
if (details.globalPosition.dy < Screens .height / 12 ||
@@ -593,6 +594,13 @@ class CameraPickerState extends State<CameraPicker>
593
594
);
594
595
_restartPointDisplayTimer ();
595
596
_currentExposureOffset.value = 0 ;
597
+ if (_exposureMode.value == ExposureMode .locked) {
598
+ _exposureMode.value = ExposureMode .auto;
599
+ await Future .wait (< Future <void >> [
600
+ controller.setExposureOffset (0 ),
601
+ controller.setExposureMode (ExposureMode .auto),
602
+ ]);
603
+ }
596
604
controller.setExposurePoint (
597
605
_lastExposurePoint.value.scale (1 / Screens .width, 1 / Screens .height),
598
606
);
@@ -601,10 +609,6 @@ class CameraPickerState extends State<CameraPicker>
601
609
_lastExposurePoint.value.scale (1 / Screens .width, 1 / Screens .height),
602
610
);
603
611
}
604
- if (_exposureMode.value == ExposureMode .locked) {
605
- _exposureMode.value = ExposureMode .auto;
606
- }
607
- _isExposureModeDisplays.value = false ;
608
612
}
609
613
610
614
/// Update the exposure offset using the exposure controller.
0 commit comments