emit method
Emits a new state and adds it to the history.
This method automatically manages history size to prevent memory leaks and tracks all emitted states for later verification.
Implementation
@override
void emit(T state) {
_checkNotDisposed();
_stateHistory.add(state);
_trimHistoryIfNeeded();
super.emit(state);
}