copyWith method

AgentStep copyWith({
  1. String? title,
  2. AgentStepStatus? status,
  3. String? detail,
  4. bool clearDetail = false,
})

Returns a copy with the given fields replaced.

A null detail keeps the current one; clearDetail removes it and wins over detail.

Implementation

AgentStep copyWith({
  String? title,
  AgentStepStatus? status,
  String? detail,
  bool clearDetail = false,
}) => AgentStep(
  id: id,
  title: title ?? this.title,
  status: status ?? this.status,
  detail: clearDetail ? null : detail ?? this.detail,
);