copyWith method

CameraValue copyWith({
  1. bool? isInitialized,
  2. bool? isRecordingVideo,
  3. bool? isTakingPicture,
  4. bool? isStreamingImages,
  5. String? errorDescription,
  6. Size? previewSize,
  7. bool? isRecordingPaused,
  8. FlashMode? flashMode,
  9. ExposureMode? exposureMode,
  10. FocusMode? focusMode,
  11. bool? exposurePointSupported,
  12. bool? focusPointSupported,
  13. DeviceOrientation? deviceOrientation,
  14. Optional<DeviceOrientation>? lockedCaptureOrientation,
  15. Optional<DeviceOrientation>? recordingOrientation,
  16. bool? isPreviewPaused,
  17. CameraDescription? description,
  18. Optional<DeviceOrientation>? previewPauseOrientation,
})

Creates a modified copy of the object.

Explicitly specified fields get the specified value, all other fields get the same value of the current object.

Implementation

CameraValue copyWith({
  bool? isInitialized,
  bool? isRecordingVideo,
  bool? isTakingPicture,
  bool? isStreamingImages,
  String? errorDescription,
  Size? previewSize,
  bool? isRecordingPaused,
  FlashMode? flashMode,
  ExposureMode? exposureMode,
  FocusMode? focusMode,
  bool? exposurePointSupported,
  bool? focusPointSupported,
  DeviceOrientation? deviceOrientation,
  Optional<DeviceOrientation>? lockedCaptureOrientation,
  Optional<DeviceOrientation>? recordingOrientation,
  bool? isPreviewPaused,
  CameraDescription? description,
  Optional<DeviceOrientation>? previewPauseOrientation,
}) {
  return CameraValue(
    isInitialized: isInitialized ?? this.isInitialized,
    errorDescription: errorDescription,
    previewSize: previewSize ?? this.previewSize,
    isRecordingVideo: isRecordingVideo ?? this.isRecordingVideo,
    isTakingPicture: isTakingPicture ?? this.isTakingPicture,
    isStreamingImages: isStreamingImages ?? this.isStreamingImages,
    isRecordingPaused: isRecordingPaused ?? _isRecordingPaused,
    flashMode: flashMode ?? this.flashMode,
    exposureMode: exposureMode ?? this.exposureMode,
    focusMode: focusMode ?? this.focusMode,
    exposurePointSupported:
        exposurePointSupported ?? this.exposurePointSupported,
    focusPointSupported: focusPointSupported ?? this.focusPointSupported,
    deviceOrientation: deviceOrientation ?? this.deviceOrientation,
    lockedCaptureOrientation: lockedCaptureOrientation == null
        ? this.lockedCaptureOrientation
        : lockedCaptureOrientation.orNull,
    recordingOrientation: recordingOrientation == null
        ? this.recordingOrientation
        : recordingOrientation.orNull,
    isPreviewPaused: isPreviewPaused ?? this.isPreviewPaused,
    description: description ?? this.description,
    previewPauseOrientation: previewPauseOrientation == null
        ? this.previewPauseOrientation
        : previewPauseOrientation.orNull,
  );
}