Skip to content

Commit

Permalink
🚑️ Fix set exposure point crashes when switching between cameras (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
leftcoding authored Dec 24, 2021
1 parent 8b8fac8 commit 5d59238
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/src/widgets/camera_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,12 @@ class CameraPickerState extends State<CameraPicker>
) {
return Positioned.fill(
child: GestureDetector(
onTapUp: (TapUpDetails d) => setExposureAndFocusPoint(d, constraints),
onTapUp: (TapUpDetails d) {
// Only call exposure point updates when the controller is initialized.
if (_controller?.value.isInitialized == true) {
setExposureAndFocusPoint(d, constraints);
}
},
behavior: HitTestBehavior.translucent,
child: const SizedBox.expand(),
),
Expand Down

0 comments on commit 5d59238

Please sign in to comment.