copyWith method
Creates a copy of metrics with updated fields
Implementation
StepMetrics copyWith({
Duration? duration,
bool? isSuccess,
Object? error,
}) {
return StepMetrics()
..duration = duration ?? this.duration
..isSuccess = isSuccess ?? this.isSuccess
..error = error ?? this.error;
}