copyWith method

StepMetrics copyWith({
  1. Duration? duration,
  2. bool? isSuccess,
  3. Object? error,
})

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;
}