CubitEx<T> mixin
This is an extension pacckage for bloc Cubit
( enables - dispatching actions, adding effects, communications among cubits, rxDart full features etc. inside the cubits ).
Properties
- action$ → Actions
-
Return a
Actions
instance.no setter - composite ↔ CompositeSubscription
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- isClosed → bool
-
Whether the bloc is closed.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → T
-
The current state.
no setterinherited
-
stream
→ Stream<
T> -
The current stream of states.
no setterinherited
-
stream$
→ Stream<
T> -
Return the current state of the cubit as a Stream
.no setter
Methods
-
$initEx(
) → void - You need to call this function to receive action on you cubit and to enable communications to the other cubits.
-
addError(
Object error, [StackTrace? stackTrace]) → void -
Reports an
error
which triggers onError with an optional StackTrace.inherited -
close(
) → Future< void> - Closes the instance. This method should be called when the instance is no longer needed. Once close is called, the instance can no longer be used.
-
dispatch(
Action action) → void - Dispatching an action is just like firing an event.
-
effectOnAction(
Stream< T> aStream) → void -
Use this function inside
onInit()
method only -
emit(
T state) → void -
Updates the
state
to the providedstate
. emit does nothing if thestate
being emitted is equal to the currentstate
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onAction(
Action action) → void - This function fired when action dispatches from the cubits.
-
onChange(
Change< T> change) → void -
Called whenever a
change
occurs with the givenchange
. Achange
occurs when a newstate
is emitted. onChange is called before thestate
of thecubit
is updated. onChange is a great spot to add logging/analytics for a specificcubit
.inherited -
onError(
Object error, StackTrace stackTrace) → void -
Called whenever an
error
occurs and notifiesBlocObserver.onError
.inherited -
onInit(
) → void - This function calls after $initEx().
-
remoteCubit<
C extends CubitEx> () → Stream< C> - This function returns the Cubit instance as a Steam depends on the generic type you attached with the function.
-
remoteState<
C extends CubitEx< (S> , S>) → Future< S> -
This function returns the current state of a cubit as a
Future
value -
remoteStream<
C extends CubitEx< (S> , S>) → Stream< S> - This function returns the state of a the Cubit instance as a Steam depends on the generic types you attached with the function.
-
select<
S> (S mapCallback(T state)) → Stream< S> -
Return the part of the current state of the cubit as a Stream
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited