Skip to content

Commit 94f9e9d

Browse files
authored
🚸 Prevent duplicate shooting actions (#204)
Fixes #202
1 parent 486a840 commit 94f9e9d

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ that can be found in the LICENSE file. -->
66

77
See the [Migration Guide](guides/migration_guide.md) for the details of breaking changes between versions.
88

9+
## Unreleased
10+
11+
### Fixes
12+
13+
- Prevent duplicate shooting actions.
14+
915
## 4.0.2
1016

1117
### Fixes

lib/src/states/camera_picker_state.dart

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -883,18 +883,20 @@ class CameraPickerState extends State<CameraPicker>
883883
}
884884

885885
PointerMoveEventListener? onPointerMove(BoxConstraints c) {
886-
if (innerController != null && enablePullToZoomInRecord) {
886+
if (innerController != null &&
887+
enablePullToZoomInRecord &&
888+
controller.value.isRecordingVideo) {
887889
return (PointerMoveEvent e) => onShootingButtonMove(e, c);
888890
}
889891
return null;
890892
}
891893

892894
GestureTapCallback? get onTap {
893-
if (innerController == null) {
895+
if (innerController == null || isControllerBusy) {
894896
return null;
895897
}
896898
if (enableTapRecording) {
897-
if (innerController?.value.isRecordingVideo ?? false) {
899+
if (controller.value.isRecordingVideo) {
898900
return stopRecordingVideo;
899901
}
900902
return () {
@@ -911,7 +913,7 @@ class CameraPickerState extends State<CameraPicker>
911913
}
912914

913915
String? get onTapHint {
914-
if (innerController == null) {
916+
if (innerController == null || isControllerBusy) {
915917
return null;
916918
}
917919
if (enableTapRecording) {
@@ -927,7 +929,7 @@ class CameraPickerState extends State<CameraPicker>
927929
}
928930

929931
GestureLongPressCallback? get onLongPress {
930-
if (innerController == null) {
932+
if (innerController == null || isControllerBusy) {
931933
return null;
932934
}
933935
if (enableRecording && !enableTapRecording) {
@@ -937,7 +939,7 @@ class CameraPickerState extends State<CameraPicker>
937939
}
938940

939941
String? get onLongPressHint {
940-
if (innerController == null) {
942+
if (innerController == null || isControllerBusy) {
941943
return null;
942944
}
943945
if (enableRecording && !enableTapRecording) {

0 commit comments

Comments
 (0)