BlocState class

Provides a BLoC model interface to a class. Provides a PublishSubject stream that can be subscribed to for updates. Also exposes a StreamSink and an Observable for more control over the output. Updates are typically triggered by calling the publishUpdate method.

Constructors

BlocState()

Properties

controller BlocController
The enclosing controller for this state
read / write
sink → StreamSink<BlocState>
read-only
stream → Observable<BlocState>
read-only
hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

dispose() → void
Closes the underlying stream. Inheriting classes that overload this method must call super.dispose().
@mustCallSuper
mutate(void mutation()) → Future<void>
Notify the underlying state that the internal data has changed. [...]
onError(Object error, StackTrace stackTrace) → void
Method that is called when the stream reports an error. Prints the error message by default.
@protected
postMutate() → void
Method that is called when mutate is called, after the stream is notified. Does nothing by default.
@protected
preMutate() → void
Method that is called when mutate is called but before the stream is notified. Does nothing by default.
@protected
subscribeToMutations(void onMutate(BlocState), { void onError(Error, StackTrace), void onDone() }) → StreamSubscription
Registers the given callback methods with the underlying stream and returns the resulting StreamSubscription.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited