File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ that can be found in the LICENSE file. -->
6
6
7
7
## 3.7.0
8
8
9
+ ### New features
10
+
11
+ - Add ` preferredFlashMode ` , allowing users to choose which flash mode is preferred when first using the camera. (#158 )
12
+
9
13
### Improvements
10
14
11
15
- Allow flash modes failed to switch and can move on to next when switching. (#156 )
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ class CameraPickerConfig {
33
33
this .resolutionPreset = ResolutionPreset .max,
34
34
this .imageFormatGroup = ImageFormatGroup .unknown,
35
35
this .preferredLensDirection = CameraLensDirection .back,
36
+ this .preferredFlashMode = FlashMode .auto,
36
37
this .lockCaptureOrientation,
37
38
this .foregroundBuilder,
38
39
this .previewTransformBuilder,
@@ -138,6 +139,11 @@ class CameraPickerConfig {
138
139
/// 摄像机在拍摄时锁定的旋转角度
139
140
final DeviceOrientation ? lockCaptureOrientation;
140
141
142
+ /// Which flash mode is preferred when first using the camera,
143
+ /// typically with the auto mode.
144
+ /// 首次使用相机时首选的闪光灯,通常是自动模式。
145
+ final FlashMode preferredFlashMode;
146
+
141
147
/// {@macro wechat_camera_picker.EntitySaveCallback}
142
148
final EntitySaveCallback ? onEntitySaving;
143
149
Original file line number Diff line number Diff line change @@ -337,6 +337,8 @@ class CameraPickerState extends State<CameraPicker>
337
337
newController
338
338
.getMinZoomLevel ()
339
339
.then ((double value) => minAvailableZoom = value),
340
+ if (pickerConfig.preferredFlashMode != FlashMode .auto)
341
+ newController.setFlashMode (pickerConfig.preferredFlashMode),
340
342
],
341
343
eagerError: true ,
342
344
);
You can’t perform that action at this time.
0 commit comments