setDescription method

Future<void> setDescription(
  1. CameraDescription description
)

Sets the description of the camera.

On Android, you must start the recording with startVideoRecording with enablePersistentRecording set to true to avoid cancelling any active recording.

Throws a CameraException if setting the description fails.

Implementation

Future<void> setDescription(CameraDescription description) async {
  if (value.isRecordingVideo) {
    await CameraPlatform.instance.setDescriptionWhileRecording(description);
    value = value.copyWith(description: description);
  } else {
    if (_initializeFuture != null) {
      await _initializeFuture;
      await CameraPlatform.instance.dispose(_cameraId);
    }

    await _initializeWithDescription(description);
  }
}