StepState<Input, Output> class

Immutable state of a single step execution that holds all execution details.

Key features:

  • Input/output data tracking
  • Execution timing
  • Error information
  • Status tracking

Example:

final state = StepState(
  step: ValidationStep(),
  input: requestData,
  status: StepStatus.completed,
  startTime: DateTime.now(),
);

if (state.isSuccess) {
  print('Duration: ${state.duration}');
}

Constructors

StepState({required ChainStep<Input, Output> step, required Input input, Output? output, required StepStatus status, required DateTime startTime, DateTime? endTime, Object? error})
Immutable state of a single step execution that holds all execution details.

Properties

duration Duration?
Duration of step execution
no setter
endTime DateTime?
When step execution ended (if completed)
final
error Object?
Error that occurred during execution (if any)
final
hashCode int
The hash code for this object.
no setterinherited
input → Input
Input data that was passed to the step
final
isError bool
Whether step failed with error
no setter
isFinished bool
Whether step execution is finished
no setter
isRolledBack bool
Whether step was rolled back
no setter
isSuccess bool
Whether step completed successfully
no setter
output → Output?
Output data produced by the step (if successful)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startTime DateTime
When step execution started
final
status StepStatus
Current status of the step
final
step ChainStep<Input, Output>
The step that was executed
final

Methods

copyWith({Output? output, StepStatus? status, DateTime? endTime, Object? error}) StepState<Input, Output>
Creates a copy of this state with updated fields
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited