entity property

  1. @protected
  2. @useResult
E entity

The current entity instance of this UseCase.

Updating this variable will synchronously call all the listeners. Notifying the listeners is O(N) with N the number of listeners.

Updating the domain state will throw if at least one listener throws.

For testing purposes, you can use debugEntity to access the domain state.

Implementation

@protected
@useResult

/// The current entity instance of this [UseCase].
///
/// Updating this variable will synchronously call all the listeners.
/// Notifying the listeners is O(N) with N the number of listeners.
///
/// Updating the domain state will throw if at least one listener throws.
///
/// For testing purposes, you can use [debugEntity] to access the domain state.
E get entity => super.state;
  1. @protected
void entity=(E newEntity)

Updates the entity with the newEntity and notifies all the listeners.

For testing purposes, you can use debugEntityUpdate to update use case state.

Implementation

@protected

/// Updates the [entity] with the [newEntity] and notifies all the listeners.
///
/// For testing purposes, you can use [debugEntityUpdate] to update use case state.
set entity(E newEntity) => super.state = newEntity;