Skip to content

Commit f09021e

Browse files
committed
📝 Add document for enableAudio.
1 parent 3806ea0 commit f09021e

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

README-ZH.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Language: [English](README.md) | 中文简体
4545
| ------------------------ | -------------------------- | ----------------------------------------------------------------- | -------------------------------------- |
4646
| isAllowRecording | `bool` | 选择器是否可以录像 | `false` |
4747
| isOnlyAllowRecording | `bool` | 选择器是否仅可以录像。只在 `isAllowRecording``true` 时有效。 | `false` |
48+
| enabledAudio | `bool` | 选择器是否需要录制音频。只于录像配合有效。 | `true` |
4849
| maximumRecordingDuration | `Duration` | 录制视频最长时长 | `const Duration(seconds: 15)` |
4950
| theme | `ThemeData` | 选择器的主题 | `CameraPicker.themeData(C.themeColor)` |
5051
| textDelegate | `CameraPickerTextDelegate` | 控制部件中的文字实现 | `DefaultCameraPickerTextDelegate` |

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ Reference:
7171
| ------------------------ | -------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------- |
7272
| isAllowRecording | `bool` | Whether the picker can record video. | `false` |
7373
| isOnlyAllowRecording | `bool` | Whether the picker can only record video. Only available when `isAllowRecording` is `true `. | `false` |
74+
| enableAudio | `bool` | Whether Whether the picker should record audio. Only available with recording. | `true` |
7475
| maximumRecordingDuration | `Duration` | The maximum duration of the video recording process. | `const Duration(seconds: 15)` |
7576
| theme | `ThemeData` | Theme data for the picker. | `CameraPicker.themeData(C.themeColor)` |
7677
| textDelegate | `CameraPickerTextDelegate` | Text delegate that controls text in widgets. | `DefaultCameraPickerTextDelegate` |

lib/src/widget/camera_picker.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ class CameraPickerState extends State<CameraPicker> {
242242

243243
/// Whether the picker should record audio. (A non-null wrapper)
244244
/// 选择器录制视频时,是否需要录制音频(非空包装)
245+
///
246+
/// No audio integration required when it's only for camera.
247+
/// 在仅允许拍照时不需要启用音频
245248
bool get enableAudio => isAllowRecording && (widget.enableAudio ?? true);
246249

247250
/// Getter for `widget.maximumRecordingDuration` .

0 commit comments

Comments
 (0)