copyWith method

MobileScannerState copyWith({
  1. int? availableCameras,
  2. CameraFacing? cameraDirection,
  3. CameraLensType? cameraLensType,
  4. MobileScannerException? error,
  5. bool? isInitialized,
  6. bool? isStarting,
  7. bool? isRunning,
  8. Size? size,
  9. TorchState? torchState,
  10. DeviceOrientation? deviceOrientation,
  11. double? zoomScale,
})

Create a copy of this state with the given parameters.

Implementation

MobileScannerState copyWith({
  int? availableCameras,
  CameraFacing? cameraDirection,
  CameraLensType? cameraLensType,
  MobileScannerException? error,
  bool? isInitialized,
  bool? isStarting,
  bool? isRunning,
  Size? size,
  TorchState? torchState,
  DeviceOrientation? deviceOrientation,
  double? zoomScale,
}) {
  return MobileScannerState(
    availableCameras: availableCameras ?? this.availableCameras,
    cameraDirection: cameraDirection ?? this.cameraDirection,
    cameraLensType: cameraLensType ?? this.cameraLensType,
    error: error,
    isInitialized: isInitialized ?? this.isInitialized,
    isStarting: isStarting ?? this.isStarting,
    isRunning: isRunning ?? this.isRunning,
    size: size ?? this.size,
    torchState: torchState ?? this.torchState,
    deviceOrientation: deviceOrientation ?? this.deviceOrientation,
    zoomScale: zoomScale ?? this.zoomScale,
  );
}