emitChanges method

void emitChanges(
  1. CubitEntity updatedCubit
)

Implementation

void emitChanges(CubitEntity updatedCubit) {
  /// Check if the variable is in the state
  assert(state.cubits.containsKey(updatedCubit.id));

  final temp = {...state.instantiatedCubits};
  temp[updatedCubit.id] = updatedCubit;

  emit(state.copyWith(instantiatedCubits: temp));
  _cubitUpdateController.add(CubitUpdate(updatedCubit.id, updatedCubit));
}