copyWith method

AIState<T> copyWith({
  1. T? data,
  2. bool? loading,
  3. Exception? error,
  4. AIStatus? status,
  5. int? progress,
  6. CostSummary? cost,
  7. bool? budgetExceeded,
})

Creates a copy with optional overrides

Implementation

AIState<T> copyWith({
  T? data,
  bool? loading,
  Exception? error,
  AIStatus? status,
  int? progress,
  CostSummary? cost,
  bool? budgetExceeded,
}) {
  return AIState<T>(
    data: data ?? this.data,
    loading: loading ?? this.loading,
    error: error ?? this.error,
    status: status ?? this.status,
    progress: progress ?? this.progress,
    cost: cost ?? this.cost,
    budgetExceeded: budgetExceeded ?? this.budgetExceeded,
  );
}