initialState<S> method

S initialState<S>()

Returns initial value for state of S type. Returns null if this Bloc was disposed.

Throws ArgumentError if state of such type was not registered.

Implementation

S initialState<S>() => isDisposed
    ? throw StateError('Bloc has been already disposed')
    : _store[S].initialState;