copyWith method

CameraPickerConfig copyWith({
  1. bool? enableRecording,
  2. bool? onlyEnableRecording,
  3. bool? enableTapRecording,
  4. bool? enableAudio,
  5. bool? enableSetExposure,
  6. bool? enableExposureControlOnPoint,
  7. bool? enablePinchToZoom,
  8. bool? enablePullToZoomInRecord,
  9. bool? enableScaledPreview,
  10. bool? shouldDeletePreviewFile,
  11. bool? shouldAutoPreviewVideo,
  12. Duration? maximumRecordingDuration,
  13. ThemeData? theme,
  14. int? cameraQuarterTurns,
  15. CameraPickerTextDelegate? textDelegate,
  16. ResolutionPreset? resolutionPreset,
  17. ImageFormatGroup? imageFormatGroup,
  18. CameraLensDirection? preferredLensDirection,
  19. ForegroundBuilder? foregroundBuilder,
  20. PreviewTransformBuilder? previewTransformBuilder,
  21. DeviceOrientation? lockCaptureOrientation,
  22. EntitySaveCallback? onEntitySaving,
  23. CameraErrorHandler? onError,
  24. XFileCapturedCallback? onXFileCaptured,
})

Implementation

CameraPickerConfig copyWith({
  /// Whether the picker can record video.
  /// 选择器是否可以录像
  bool? enableRecording,

  /// Whether the picker can record video.
  /// 选择器是否可以录像
  bool? onlyEnableRecording,

  /// Whether allow the record can start with single tap.
  /// 选择器是否可以单击录像
  ///
  /// It only works when [onlyEnableRecording] is true.
  /// 仅在 [onlyEnableRecording] 为 true 时生效。
  bool? enableTapRecording,

  /// Whether the picker should record audio.
  /// 选择器录像时是否需要录制声音
  bool? enableAudio,

  /// Whether users can set the exposure point by tapping.
  /// 用户是否可以在界面上通过点击设定曝光点
  bool? enableSetExposure,

  /// Whether users can adjust exposure according to the set point.
  /// 用户是否可以根据已经设置的曝光点调节曝光度
  bool? enableExposureControlOnPoint,

  /// Whether users can zoom the camera by pinch.
  /// 用户是否可以在界面上双指缩放相机对焦
  bool? enablePinchToZoom,

  /// Whether users can zoom by pulling up when recording video.
  /// 用户是否可以在录制视频时上拉缩放
  bool? enablePullToZoomInRecord,

  /// Whether the camera preview should be scaled during captures.
  /// 拍摄过程中相机预览是否需要缩放
  bool? enableScaledPreview,

  /// {@template wechat_camera_picker.shouldDeletePreviewFile}
  /// Whether the preview file will be delete when pop.
  /// 返回页面时是否删除预览文件
  /// {@endtemplate}
  bool? shouldDeletePreviewFile,

  /// {@template wechat_camera_picker.shouldAutoPreviewVideo}
  /// Whether the video should be played instantly in the preview.
  /// 在预览时是否直接播放视频
  /// {@endtemplate}
  bool? shouldAutoPreviewVideo,

  /// The maximum duration of the video recording process.
  /// 录制视频最长时长
  ///
  /// Defaults to 15 seconds, allow `null` for unrestricted video recording.
  /// 默认为 15 秒,可以使用 `null` 来设置无限制的视频录制
  Duration? maximumRecordingDuration,

  /// Theme data for the picker.
  /// 选择器的主题
  ThemeData? theme,

  /// The number of clockwise quarter turns the camera view should be rotated.
  /// 摄像机视图顺时针旋转次数,每次90度
  int? cameraQuarterTurns,

  /// Text delegate that controls text in widgets.
  /// 控制部件中的文字实现
  CameraPickerTextDelegate? textDelegate,

  /// Present resolution for the camera.
  /// 相机的分辨率预设
  ResolutionPreset? resolutionPreset,

  /// The [ImageFormatGroup] describes the output of the raw image format.
  /// 输出图像的格式描述
  ImageFormatGroup? imageFormatGroup,

  /// Which lens direction is preferred when first using the camera,
  /// typically with the front or the back direction.
  /// 首次使用相机时首选的镜头方向,通常是前置或后置。
  CameraLensDirection? preferredLensDirection,

  /// {@macro wechat_camera_picker.ForegroundBuilder}
  ForegroundBuilder? foregroundBuilder,

  /// {@macro wechat_camera_picker.PreviewTransformBuilder}
  PreviewTransformBuilder? previewTransformBuilder,

  /// Whether the camera should be locked to the specific orientation
  /// during captures.
  /// 摄像机在拍摄时锁定的旋转角度
  DeviceOrientation? lockCaptureOrientation,

  /// {@macro wechat_camera_picker.EntitySaveCallback}
  EntitySaveCallback? onEntitySaving,

  /// {@macro wechat_camera_picker.CameraErrorHandler}
  CameraErrorHandler? onError,

  /// {@macro wechat_camera_picker.XFileCapturedCallback}
  XFileCapturedCallback? onXFileCaptured,
}) =>
    CameraPickerConfig(
        enableRecording: enableRecording ?? this.enableRecording,
        onlyEnableRecording: onlyEnableRecording ?? this.onlyEnableRecording,
        enableTapRecording: enableTapRecording ?? this.enableTapRecording,
        enableAudio: enableAudio ?? this.enableAudio,
        enableSetExposure: enableSetExposure ?? this.enableSetExposure,
        enableExposureControlOnPoint:
            enableExposureControlOnPoint ?? this.enableExposureControlOnPoint,
        enablePinchToZoom: enablePinchToZoom ?? this.enablePinchToZoom,
        enablePullToZoomInRecord:
            enablePullToZoomInRecord ?? this.enablePullToZoomInRecord,
        enableScaledPreview: enableScaledPreview ?? this.enableScaledPreview,
        shouldDeletePreviewFile:
            shouldDeletePreviewFile ?? this.shouldDeletePreviewFile,
        shouldAutoPreviewVideo:
            shouldAutoPreviewVideo ?? this.shouldAutoPreviewVideo,
        maximumRecordingDuration:
            maximumRecordingDuration ?? this.maximumRecordingDuration,
        theme: theme ?? this.theme,
        textDelegate: textDelegate ?? this.textDelegate,
        cameraQuarterTurns: cameraQuarterTurns ?? this.cameraQuarterTurns,
        resolutionPreset: resolutionPreset ?? this.resolutionPreset,
        imageFormatGroup: imageFormatGroup ?? this.imageFormatGroup,
        preferredLensDirection:
            preferredLensDirection ?? this.preferredLensDirection,
        lockCaptureOrientation:
            lockCaptureOrientation ?? this.lockCaptureOrientation,
        foregroundBuilder: foregroundBuilder ?? this.foregroundBuilder,
        previewTransformBuilder:
            previewTransformBuilder ?? this.previewTransformBuilder,
        onEntitySaving: onEntitySaving ?? this.onEntitySaving,
        onError: onError ?? this.onError,
        onXFileCaptured: onXFileCaptured ?? this.onXFileCaptured);