Writable<T> class

Writable is a quick way to create a store like entity, where you can directly add states withoutt worrying about mutations.

It's only ment to be used within widget's instead of setState() or when you want to define a stream controller

You also need to call the dispose() to release the resources

Constructors

Writable({T? state, bool setInitialState = true})

Properties

cData → T?
Last emitted cached data
no setter
controller ModifiedBehaviorSubject<StateSnapshot<T>>
Controller of the event stream
no setter
hashCode int
The hash code for this object.
no setterinherited
rawStream Stream<T>
It returns a stream of T insted of StateSnapshot
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state StateSnapshot<T>
Current state
no setter
stream Stream<StateSnapshot<T>>
no setter

Methods

add(T data) → void
Emit a new state without error
addError(Object error) → void
Emit a state with error
dispose() → void
listen(void onData(StateSnapshot<T> value), {Function? onError, void onDone()?, bool? cancelOnError}) StreamSubscription<StateSnapshot<T>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setDefaultMiddlewares(List<Middleware> middlewares) → void
Sets a default middlewares that will be executed on every action
toString() String
A string representation of this object.
inherited

Operators

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