copyWith method

CockpitRecordingResult copyWith({
  1. CockpitRecordingState? state,
  2. CockpitRecordingPurpose? purpose,
  3. CockpitRecordingKind? recordingKind,
  4. Object? requestedMode = _unsetField,
  5. Object? requestedLayer = _unsetField,
  6. Object? effectiveLayer = _unsetField,
  7. bool? fallbackUsed,
  8. Object? fallbackReason = _unsetField,
  9. Object? artifact = _unsetField,
  10. Object? durationMs = _unsetField,
  11. Object? bytes = _unsetField,
  12. Object? sourceFilePath = _unsetField,
  13. Object? failureReason = _unsetField,
})

Returns a copy of this CockpitRecordingResult with supplied fields replaced.

Implementation

CockpitRecordingResult copyWith({
  CockpitRecordingState? state,
  CockpitRecordingPurpose? purpose,
  CockpitRecordingKind? recordingKind,
  Object? requestedMode = _unsetField,
  Object? requestedLayer = _unsetField,
  Object? effectiveLayer = _unsetField,
  bool? fallbackUsed,
  Object? fallbackReason = _unsetField,
  Object? artifact = _unsetField,
  Object? durationMs = _unsetField,
  Object? bytes = _unsetField,
  Object? sourceFilePath = _unsetField,
  Object? failureReason = _unsetField,
}) {
  return CockpitRecordingResult(
    state: state ?? this.state,
    purpose: purpose ?? this.purpose,
    recordingKind: recordingKind ?? this.recordingKind,
    requestedMode: identical(requestedMode, _unsetField)
        ? this.requestedMode
        : requestedMode as CockpitRecordingMode?,
    requestedLayer: identical(requestedLayer, _unsetField)
        ? this.requestedLayer
        : requestedLayer as CockpitRecordingLayer?,
    effectiveLayer: identical(effectiveLayer, _unsetField)
        ? this.effectiveLayer
        : effectiveLayer as CockpitRecordingLayer?,
    fallbackUsed: fallbackUsed ?? this.fallbackUsed,
    fallbackReason: identical(fallbackReason, _unsetField)
        ? this.fallbackReason
        : fallbackReason as String?,
    artifact: identical(artifact, _unsetField)
        ? this.artifact
        : artifact as CockpitArtifactRef?,
    durationMs: identical(durationMs, _unsetField)
        ? this.durationMs
        : durationMs as int?,
    bytes: identical(bytes, _unsetField) ? this.bytes : bytes as List<int>?,
    sourceFilePath: identical(sourceFilePath, _unsetField)
        ? this.sourceFilePath
        : sourceFilePath as String?,
    failureReason: identical(failureReason, _unsetField)
        ? this.failureReason
        : failureReason as String?,
  );
}