From 22b8fdafea9d7ac22902e10970e534d873689953 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Mon, 14 Oct 2024 17:14:20 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-ZH.md | 59 ++++++++++++++++++++++++++-------------------------- README.md | 59 ++++++++++++++++++++++++++-------------------------- 2 files changed, 60 insertions(+), 58 deletions(-) diff --git a/README-ZH.md b/README-ZH.md index 24cf247..c6a3477 100644 --- a/README-ZH.md +++ b/README-ZH.md @@ -178,35 +178,36 @@ final AssetEntity? entity = await CameraPicker.pickFromCamera( `CameraPickerConfig` 的成员说明: -| 参数名 | 类型 | 描述 | 默认值 | -|-------------------------------|-----------------------------|----------------------------------------------------|--------------------------------------------| -| enableRecording | `bool` | 选择器是否可以录像 | `false` | -| onlyEnableRecording | `bool` | 选择器是否仅可以录像。只在 `enableRecording` 为 `true` 时有效。 | `false` | -| enableTapRecording | `bool` | 选择器是否可以单击录像。只在 `onlyEnableRecording` 为 `true` 时生效。 | `false` | -| enableAudio | `bool` | 选择器是否需要录制音频。只在 `enableRecording` 为 `true` 时有效。 | `true` | -| enableSetExposure | `bool` | 用户是否可以在界面上通过点击设定曝光点 | `true` | -| enableExposureControlOnPoint | `bool` | 用户是否可以根据已经设置的曝光点调节曝光度 | `true` | -| enablePinchToZoom | `bool` | 用户是否可以在界面上双指缩放相机对焦 | `true` | -| enablePullToZoomInRecord | `bool` | 用户是否可以在录制视频时上拉缩放 | `true` | -| enableScaledPreview | `bool` | 拍摄过程中相机预览是否需要缩放 | `false` | -| shouldDeletePreviewFile | `bool` | 返回页面时是否删除预览文件 | `false` | -| shouldAutoPreviewVideo | `bool` | 在预览时是否直接播放视频 | `true` | -| maximumRecordingDuration | `Duration?` | 录制视频最长时长 | `const Duration(seconds: 15)` | -| minimumRecordingDuration | `Duration` | 录制视频最短时长 | `const Duration(seconds: 1)` | -| theme | `ThemeData?` | 选择器的主题 | `CameraPicker.themeData(wechatThemeColor)` | -| textDelegate | `CameraPickerTextDelegate?` | 控制部件中的文字实现 | `CameraPickerTextDelegate` | -| resolutionPreset | `ResolutionPreset` | 相机的分辨率预设 | `ResolutionPreset.ultraHigh` | -| cameraQuarterTurns | `int` | 摄像机视图顺时针旋转次数,每次 90 度 | `0` | -| imageFormatGroup | `ImageFormatGroup` | 输出图像的格式描述 | `ImageFormatGroup.unknown` | -| preferredLensDirection | `CameraLensDirection` | 首次使用相机时首选的镜头方向 | `CameraLensDirection.back` | -| lockCaptureOrientation | `DeviceOrientation?` | 摄像机在拍摄时锁定的旋转角度 | null | -| foregroundBuilder | `ForegroundBuilder?` | 覆盖在相机预览上方的前景构建 | null | -| previewTransformBuilder | `PreviewTransformBuilder?` | 对相机预览做变换的构建 | null | -| onEntitySaving | `EntitySaveCallback?` | 在查看器中保存图片时的回调 | null | -| onError | `CameraErrorHandler?` | 拍摄照片过程中的自定义错误处理 | null | -| onXFileCaptured | `XFileCapturedCallback?` | 拍摄文件生成后的回调 | null | -| onMinimumRecordDurationNotMet | `VoidCallback?` | 录制时长未达到最小时长时的回调方法 | null | -| onPickConfirmed | `void Function(AssetEntity)?` | 拍照或录像确认时的回调方法。 | null | +| 参数名 | 类型 | 描述 | 默认值 | +|-------------------------------|-------------------------------|----------------------------------------------------|--------------------------------------------| +| enableRecording | `bool` | 选择器是否可以录像 | `false` | +| onlyEnableRecording | `bool` | 选择器是否仅可以录像。只在 `enableRecording` 为 `true` 时有效。 | `false` | +| enableTapRecording | `bool` | 选择器是否可以单击录像。只在 `onlyEnableRecording` 为 `true` 时生效。 | `false` | +| enableAudio | `bool` | 选择器是否需要录制音频。只在 `enableRecording` 为 `true` 时有效。 | `true` | +| enableSetExposure | `bool` | 用户是否可以在界面上通过点击设定曝光点 | `true` | +| enableExposureControlOnPoint | `bool` | 用户是否可以根据已经设置的曝光点调节曝光度 | `true` | +| enablePinchToZoom | `bool` | 用户是否可以在界面上双指缩放相机对焦 | `true` | +| enablePullToZoomInRecord | `bool` | 用户是否可以在录制视频时上拉缩放 | `true` | +| enableScaledPreview | `bool` | 拍摄过程中相机预览是否需要缩放 | `false` | +| shouldDeletePreviewFile | `bool` | 返回页面时是否删除预览文件 | `false` | +| shouldAutoPreviewVideo | `bool` | 在预览时是否直接播放视频 | `true` | +| maximumRecordingDuration | `Duration?` | 录制视频最长时长 | `const Duration(seconds: 15)` | +| minimumRecordingDuration | `Duration` | 录制视频最短时长 | `const Duration(seconds: 1)` | +| theme | `ThemeData?` | 选择器的主题 | `CameraPicker.themeData(wechatThemeColor)` | +| textDelegate | `CameraPickerTextDelegate?` | 控制部件中的文字实现 | `CameraPickerTextDelegate` | +| resolutionPreset | `ResolutionPreset` | 相机的分辨率预设 | `ResolutionPreset.ultraHigh` | +| cameraQuarterTurns | `int` | 摄像机视图顺时针旋转次数,每次 90 度 | `0` | +| imageFormatGroup | `ImageFormatGroup` | 输出图像的格式描述 | `ImageFormatGroup.unknown` | +| preferredLensDirection | `CameraLensDirection` | 首次使用相机时首选的镜头方向 | `CameraLensDirection.back` | +| lockCaptureOrientation | `DeviceOrientation?` | 摄像机在拍摄时锁定的旋转角度 | null | +| foregroundBuilder | `ForegroundBuilder?` | 覆盖在相机预览上方的前景构建 | null | +| previewTransformBuilder | `PreviewTransformBuilder?` | 对相机预览做变换的构建 | null | +| onEntitySaving | `EntitySaveCallback?` | 在查看器中保存图片时的回调 | null | +| onError | `CameraErrorHandler?` | 拍摄照片过程中的自定义错误处理 | null | +| onXFileCaptured | `XFileCapturedCallback?` | 拍摄文件生成后的回调 | null | +| onMinimumRecordDurationNotMet | `VoidCallback?` | 录制时长未达到最小时长时的回调方法 | null | +| onPickConfirmed | `void Function(AssetEntity)?` | 拍照或录像确认时的回调方法。 | null | +| permissionRequestOption | `PermissionRequestOption?` | 使用 `photo_manager` 保存拍摄的文件的权限请求配置 | null | ### 使用自定义的 `State` diff --git a/README.md b/README.md index a3d26d1..1839b73 100644 --- a/README.md +++ b/README.md @@ -183,35 +183,36 @@ final AssetEntity? entity = await CameraPicker.pickFromCamera( Fields in `CameraPickerConfig`: -| Name | Type | Description | Default Value | -|-------------------------------|-----------------------------|-------------------------------------------------------------------------------------------------------|--------------------------------------------| -| enableRecording | `bool` | Whether the picker can record video. | `false` | -| onlyEnableRecording | `bool` | Whether the picker can only record video. Only available when `enableRecording` is `true `. | `false` | -| enableTapRecording | `bool` | Whether allow the record can start with single tap. Only available when `enableRecording` is `true `. | `false` | -| enableAudio | `bool` | Whether Whether the picker should record audio. Only available with recording. | `true` | -| enableSetExposure | `bool` | Whether users can set the exposure point by tapping. | `true` | -| enableExposureControlOnPoint | `bool` | Whether users can adjust exposure according to the set point. | `true` | -| enablePinchToZoom | `bool` | Whether users can zoom the camera by pinch. | `true` | -| enablePullToZoomInRecord | `bool` | Whether users can zoom by pulling up when recording video. | `true` | -| enableScaledPreview | `bool` | Whether the camera preview should be scaled during captures. | `false` | -| shouldDeletePreviewFile | `bool` | Whether the preview file will be delete when pop. | `false` | -| shouldAutoPreviewVideo | `bool` | Whether the video should be played instantly in the preview. | `true` | -| maximumRecordingDuration | `Duration?` | The maximum duration of the video recording process. | `const Duration(seconds: 15)` | -| minimumRecordingDuration | `Duration` | The minimum duration of the video recording process. | `const Duration(seconds: 1)` | -| theme | `ThemeData?` | Theme data for the picker. | `CameraPicker.themeData(wechatThemeColor)` | -| textDelegate | `CameraPickerTextDelegate?` | Text delegate that controls text in widgets. | `CameraPickerTextDelegate` | -| resolutionPreset | `ResolutionPreset` | Present resolution for the camera. | `ResolutionPreset.ultraHigh` | -| cameraQuarterTurns | `int` | The number of clockwise quarter turns the camera view should be rotated. | `0` | -| imageFormatGroup | `ImageFormatGroup` | Describes the output of the raw image format. | `ImageFormatGroup.unknown` | -| preferredLensDirection | `CameraLensDirection` | Which lens direction is preferred when first using the camera. | `CameraLensDirection.back` | -| lockCaptureOrientation | `DeviceOrientation?` | Whether the camera should be locked to the specific orientation during captures. | null | -| foregroundBuilder | `ForegroundBuilder?` | The foreground widget builder which will cover the whole camera preview. | null | -| previewTransformBuilder | `PreviewTransformBuilder?` | The widget builder which will transform the camera preview. | null | -| onEntitySaving | `EntitySaveCallback?` | The callback type define for saving entity in the viewer. | null | -| onError | `CameraErrorHandler?` | The error handler when any error occurred during the picking process. | null | -| onXFileCaptured | `XFileCapturedCallback?` | The callback type definition when the XFile is captured by the camera. | null | -| onMinimumRecordDurationNotMet | `VoidCallback?` | The callback when the recording is not met the minimum recording duration. | null | -| onPickConfirmed | `void Function(AssetEntity)?` | The callback when picture is taken or video is confirmed. | null | +| Name | Type | Description | Default Value | +|-------------------------------|-------------------------------|-------------------------------------------------------------------------------------------------------|--------------------------------------------| +| enableRecording | `bool` | Whether the picker can record video. | `false` | +| onlyEnableRecording | `bool` | Whether the picker can only record video. Only available when `enableRecording` is `true `. | `false` | +| enableTapRecording | `bool` | Whether allow the record can start with single tap. Only available when `enableRecording` is `true `. | `false` | +| enableAudio | `bool` | Whether Whether the picker should record audio. Only available with recording. | `true` | +| enableSetExposure | `bool` | Whether users can set the exposure point by tapping. | `true` | +| enableExposureControlOnPoint | `bool` | Whether users can adjust exposure according to the set point. | `true` | +| enablePinchToZoom | `bool` | Whether users can zoom the camera by pinch. | `true` | +| enablePullToZoomInRecord | `bool` | Whether users can zoom by pulling up when recording video. | `true` | +| enableScaledPreview | `bool` | Whether the camera preview should be scaled during captures. | `false` | +| shouldDeletePreviewFile | `bool` | Whether the preview file will be delete when pop. | `false` | +| shouldAutoPreviewVideo | `bool` | Whether the video should be played instantly in the preview. | `true` | +| maximumRecordingDuration | `Duration?` | The maximum duration of the video recording process. | `const Duration(seconds: 15)` | +| minimumRecordingDuration | `Duration` | The minimum duration of the video recording process. | `const Duration(seconds: 1)` | +| theme | `ThemeData?` | Theme data for the picker. | `CameraPicker.themeData(wechatThemeColor)` | +| textDelegate | `CameraPickerTextDelegate?` | Text delegate that controls text in widgets. | `CameraPickerTextDelegate` | +| resolutionPreset | `ResolutionPreset` | Present resolution for the camera. | `ResolutionPreset.ultraHigh` | +| cameraQuarterTurns | `int` | The number of clockwise quarter turns the camera view should be rotated. | `0` | +| imageFormatGroup | `ImageFormatGroup` | Describes the output of the raw image format. | `ImageFormatGroup.unknown` | +| preferredLensDirection | `CameraLensDirection` | Which lens direction is preferred when first using the camera. | `CameraLensDirection.back` | +| lockCaptureOrientation | `DeviceOrientation?` | Whether the camera should be locked to the specific orientation during captures. | null | +| foregroundBuilder | `ForegroundBuilder?` | The foreground widget builder which will cover the whole camera preview. | null | +| previewTransformBuilder | `PreviewTransformBuilder?` | The widget builder which will transform the camera preview. | null | +| onEntitySaving | `EntitySaveCallback?` | The callback type define for saving entity in the viewer. | null | +| onError | `CameraErrorHandler?` | The error handler when any error occurred during the picking process. | null | +| onXFileCaptured | `XFileCapturedCallback?` | The callback type definition when the XFile is captured by the camera. | null | +| onMinimumRecordDurationNotMet | `VoidCallback?` | The callback when the recording is not met the minimum recording duration. | null | +| onPickConfirmed | `void Function(AssetEntity)?` | The callback when picture is taken or video is confirmed. | null | +| permissionRequestOption | `PermissionRequestOption?` | The permission request option when saving the captured file using the `photo_manager` package. | null | ### Using custom `State`s