Skip to content

Commit 5d59238

Browse files
authored
🚑️ Fix set exposure point crashes when switching between cameras (#66)
1 parent 8b8fac8 commit 5d59238

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/src/widgets/camera_picker.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,12 @@ class CameraPickerState extends State<CameraPicker>
13161316
) {
13171317
return Positioned.fill(
13181318
child: GestureDetector(
1319-
onTapUp: (TapUpDetails d) => setExposureAndFocusPoint(d, constraints),
1319+
onTapUp: (TapUpDetails d) {
1320+
// Only call exposure point updates when the controller is initialized.
1321+
if (_controller?.value.isInitialized == true) {
1322+
setExposureAndFocusPoint(d, constraints);
1323+
}
1324+
},
13201325
behavior: HitTestBehavior.translucent,
13211326
child: const SizedBox.expand(),
13221327
),

0 commit comments

Comments
 (0)