CameraPicker class
Create a camera picker integrate with CameraDescription. 通过 CameraDescription 整合的拍照选择
The picker provides create an AssetEntity through the camera. 该选择器可以通过拍照创建 AssetEntity。
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- CameraPicker
Constructors
- CameraPicker({Key? key, bool enableRecording = false, bool onlyEnableRecording = false, bool enableTapRecording = false, bool enableAudio = true, bool enableSetExposure = true, bool enableExposureControlOnPoint = true, bool enablePinchToZoom = true, bool enablePullToZoomInRecord = true, bool shouldDeletePreviewFile = false, bool shouldAutoPreviewVideo = false, Duration? maximumRecordingDuration = const Duration(seconds: 15), ThemeData? theme, ResolutionPreset resolutionPreset = ResolutionPreset.max, ImageFormatGroup imageFormatGroup = ImageFormatGroup.unknown, CameraLensDirection preferredLensDirection = CameraLensDirection.back, int cameraQuarterTurns = 0, Widget foregroundBuilder(CameraValue)?, EntitySaveCallback? onEntitySaving, CameraErrorHandler? onError, CameraPickerTextDelegate? textDelegate})
Properties
- cameraQuarterTurns → int
-
The number of clockwise quarter turns the camera view should be rotated.
摄像机视图顺时针旋转次数,每次90度
final
- enableAudio → bool
-
Whether the picker should record audio.
选择器录像时是否需要录制声音
final
- enableExposureControlOnPoint → bool
-
Whether users can adjust exposure according to the set point.
用户是否可以根据已经设置的曝光点调节曝光度
final
- enablePinchToZoom → bool
-
Whether users can zoom the camera by pinch.
用户是否可以在界面上双指缩放相机对焦
final
- enablePullToZoomInRecord → bool
-
Whether users can zoom by pulling up when recording video.
用户是否可以在录制视频时上拉缩放
final
- enableRecording → bool
-
Whether the picker can record video.
选择器是否可以录像
final
- enableSetExposure → bool
-
Whether users can set the exposure point by tapping.
用户是否可以在界面上通过点击设定曝光点
final
- enableTapRecording → bool
-
Whether allow the record can start with single tap.
选择器是否可以单击录像
final
- foregroundBuilder → (Widget Function(CameraValue)?)
-
The foreground widget builder which will cover the whole camera preview.
覆盖在相机预览上方的前景构建
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- imageFormatGroup → ImageFormatGroup
-
The ImageFormatGroup describes the output of the raw image format.
输出图像的格式描述
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- maximumRecordingDuration → Duration?
-
The maximum duration of the video recording process.
录制视频最长时长
final
- onEntitySaving → EntitySaveCallback?
-
The callback type define for saving entity in the viewer.
在查看器中保存图片时的回调
final
- onError → CameraErrorHandler?
-
The error handler when any error occurred during the picking process.
拍摄照片过程中的自定义错误处理
final
- onlyEnableRecording → bool
-
Whether the picker can record video.
选择器是否可以录像
final
- preferredLensDirection → CameraLensDirection
-
Which lens direction is preferred when first using the camera,
typically with the front or the back direction.
首次使用相机时首选的镜头方向,通常是前置或后置。
final
- resolutionPreset → ResolutionPreset
-
Present resolution for the camera.
相机的分辨率预设
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shouldAutoPreviewVideo → bool
-
Whether the video should be played instantly in the preview.
在预览时是否直接播放视频
final
- shouldDeletePreviewFile → bool
-
Whether the preview file will be delete when pop.
返回页面时是否删除预览文件
final
- theme → ThemeData?
-
Theme data for the picker.
选择器的主题
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → CameraPickerState -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNode
objects describing this node's children.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
pickFromCamera(
BuildContext context, {bool enableRecording = false, bool onlyEnableRecording = false, bool enableTapRecording = false, bool enableAudio = true, bool enableSetExposure = true, bool enableExposureControlOnPoint = true, bool enablePinchToZoom = true, bool enablePullToZoomInRecord = true, bool shouldDeletePreviewFile = false, bool shouldAutoPreviewVideo = false, Duration maximumRecordingDuration = const Duration(seconds: 15), ThemeData? theme, int cameraQuarterTurns = 0, CameraPickerTextDelegate? textDelegate, ResolutionPreset resolutionPreset = ResolutionPreset.max, ImageFormatGroup imageFormatGroup = ImageFormatGroup.unknown, CameraLensDirection preferredLensDirection = CameraLensDirection.back, Widget foregroundBuilder(CameraValue)?, EntitySaveCallback? onEntitySaving, CameraErrorHandler? onError, }) → Future< AssetEntity?> -
Static method to create
AssetEntity
through camera. 通过相机创建AssetEntity
的静态方法 -
themeData(
Color themeColor) → ThemeData - Build a dark theme according to the theme color. 通过主题色构建一个默认的暗黑主题