Skip to content

Commit

Permalink
🚸 Prevent duplicate shooting actions (#204)
Browse files Browse the repository at this point in the history
Fixes #202
  • Loading branch information
AlexV525 authored Oct 4, 2023
1 parent 486a840 commit 94f9e9d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ that can be found in the LICENSE file. -->

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

## Unreleased

### Fixes

- Prevent duplicate shooting actions.

## 4.0.2

### Fixes
Expand Down
14 changes: 8 additions & 6 deletions lib/src/states/camera_picker_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -883,18 +883,20 @@ class CameraPickerState extends State<CameraPicker>
}

PointerMoveEventListener? onPointerMove(BoxConstraints c) {
if (innerController != null && enablePullToZoomInRecord) {
if (innerController != null &&
enablePullToZoomInRecord &&
controller.value.isRecordingVideo) {
return (PointerMoveEvent e) => onShootingButtonMove(e, c);
}
return null;
}

GestureTapCallback? get onTap {
if (innerController == null) {
if (innerController == null || isControllerBusy) {
return null;
}
if (enableTapRecording) {
if (innerController?.value.isRecordingVideo ?? false) {
if (controller.value.isRecordingVideo) {
return stopRecordingVideo;
}
return () {
Expand All @@ -911,7 +913,7 @@ class CameraPickerState extends State<CameraPicker>
}

String? get onTapHint {
if (innerController == null) {
if (innerController == null || isControllerBusy) {
return null;
}
if (enableTapRecording) {
Expand All @@ -927,7 +929,7 @@ class CameraPickerState extends State<CameraPicker>
}

GestureLongPressCallback? get onLongPress {
if (innerController == null) {
if (innerController == null || isControllerBusy) {
return null;
}
if (enableRecording && !enableTapRecording) {
Expand All @@ -937,7 +939,7 @@ class CameraPickerState extends State<CameraPicker>
}

String? get onLongPressHint {
if (innerController == null) {
if (innerController == null || isControllerBusy) {
return null;
}
if (enableRecording && !enableTapRecording) {
Expand Down

0 comments on commit 94f9e9d

Please sign in to comment.