copyWith method

StepState<Input, Output> copyWith({
  1. Output? output,
  2. StepStatus? status,
  3. DateTime? endTime,
  4. Object? error,
})

Creates a copy of this state with updated fields

Implementation

StepState<Input, Output> copyWith({
  Output? output,
  StepStatus? status,
  DateTime? endTime,
  Object? error,
}) {
  return StepState(
    step: step,
    input: input,
    output: output ?? this.output,
    status: status ?? this.status,
    startTime: startTime,
    endTime: endTime ?? this.endTime,
    error: error ?? this.error,
  );
}