AutoPersistedBloc<S> class abstract

If bloc is not a singleton then tags must be provided to differentiate between different instances, otherwise different instances will overwrite each other

Inheritance
Available Extensions

Constructors

AutoPersistedBloc(PersistenceService _persistenceService, {S? startState, BlocMonitor<Bloc, dynamic> monitor = const BlocEventsPrinter(), Object tag = 0, Deserializer<S>? deserializer, Serializer<S>? serializer})

Properties

deserializer Deserializer<S>?
final
error → dynamic
no setterinherited
hasError bool
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasState bool
no setterinherited
initialization Future<void>
no setter
isBusy bool
no setterinherited
persistenceKey String
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serializer Serializer<S>?
final
state → S
no setterinherited
stream Stream<S?>
Broadcast Stream to which all builders listen
no setterinherited
tag Object
final

Methods

addListener(BlocListener callback) → void
Adds a callback function to the list on active callbacks
inherited
close() Future<void>
Send a done event and disposes the stream
inherited
listen(BuildContext context, BlocListener callback) → void
Notifies listeners of any events taking place inside this bloc. A widget can only call this once.
inherited
nextState(S? currentState, S update) → S?
Called to calculate the new state
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners(BlocEventType type) → void
Calls all callbacks currently active
inherited
onActivate() → void
Called when Bloc get the first listener and stream is created
inherited
onDeactivate() → void
Called when Bloc has no more listeners and stream is being closed
inherited
refresh() → void
Broadcasts the same state
inherited
removeListener(BlocListener callback) → void
Removes a callback function from the list
inherited
removePersistedState() → void
Removes the state persisted in this bloc
setBusy({String? event}) → void
Called by blocs (subclasses) when the updated state isn't available immediately
inherited
setError(dynamic error, {String? event}) → void
Called by blocs (subclasses) when an error occurs
inherited
setState(S update, {String? event, bool shouldPersist = true}) → void
Called by blocs (subclasses) when the state is updated
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited