Skip to content

Commit

Permalink
🚸 Prevent switching cameras when taking picture or recording video (#120
Browse files Browse the repository at this point in the history
)
  • Loading branch information
AlexV525 authored Aug 9, 2022
1 parent f50c499 commit 98392a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ that can be found in the LICENSE file. -->

# Changelog

## 3.5.0-dev.3

### Improvements

- Prevent switching cameras when taking picture or recording video. (#120)

## 3.5.0-dev.2

### Improvements
Expand Down
4 changes: 4 additions & 0 deletions lib/src/states/camera_picker_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ class CameraPickerState extends State<CameraPicker>
/// of cameras, start from the beginning.
/// 按顺序切换相机。当达到相机数量时从头开始。
void switchCameras() {
// Skip switching when taking picture or recording video.
if (controller.value.isTakingPicture || controller.value.isRecordingVideo) {
return;
}
++currentCameraIndex;
if (currentCameraIndex == cameras.length) {
currentCameraIndex = 0;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: wechat_camera_picker
description: A camera picker which is an extension to wechat_assets_picker, but can be run separately.
version: 3.5.0-dev.2
version: 3.5.0-dev.3
homepage: https://github.com/fluttercandies/flutter_wechat_camera_picker

environment:
Expand Down

0 comments on commit 98392a0

Please sign in to comment.