copyWith method

CubitEntity copyWith({
  1. ID? id,
  2. String? name,
  3. ID? initialState,
  4. Map<ID, CubitStateEntity>? states,
  5. Map<ID, WorkflowEntity>? workflows,
  6. ID? currentState,
  7. List<CubitStateEntity>? stateHistory,
})

Implementation

CubitEntity copyWith({
  ID? id,
  String? name,
  ID? initialState,
  Map<ID, CubitStateEntity>? states,
  Map<ID, WorkflowEntity>? workflows,
  ID? currentState,
  List<CubitStateEntity>? stateHistory,
}) {
  return CubitEntity(
    id: id ?? this.id,
    name: name ?? this.name,
    initialState: initialState ?? this.initialState,
    states: states ?? this.states,
    workflows: workflows ?? this.workflows,
    currentState: currentState ?? this.currentState,
    stateHistory: stateHistory ?? this.stateHistory,
  );
}