BaseStateNotifier<DataState> class abstract

Inheritance

Constructors

BaseStateNotifier(Ref<Object?> ref)

Properties

debugState BaseState<DataState>
A development-only way to access state outside of StateNotifier.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
If a listener has been added using addListener and hasn't been removed yet.
no setterinherited
mounted bool
Whether dispose was called or not.
no setterinherited
onError ↔ ErrorListener?
A callback for error reporting if one of the listeners added with addListener throws.
getter/setter pairinherited
ref → Ref<Object?>
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state BaseState<DataState>
The current "state" of this StateNotifier.
getter/setter pairinherited
stream Stream<BaseState<DataState>>
A broadcast stream representation of a StateNotifier.
no setterinherited

Methods

addListener(Listener<BaseState<DataState>> listener, {bool fireImmediately = true}) → RemoveListener
Subscribes to this object.
inherited
cancelThrottle({String throttleIdentifier = ''}) → void
Cancels if throttling is in progress
inherited
clearGlobalLoading() → void
Clear BaseLoadingIndicator
inherited
debounce({Duration duration = const Duration(milliseconds: 500)}) Future<void>
Wait to collect multiple method calls for certain duration before allowing only one method call to proceed
inherited
dispose() → void
Frees all the resources associated with this object.
inherited
execute(EitherFailureOr<DataState> function, {PreHandleData<DataState>? onDataReceived, PreHandleFailure? onFailureOccurred, bool withLoadingState = true, bool globalLoading = false, bool globalFailure = true}) Future<void>
Executes received function with additional parameters to control if loading state should be set while executing function by providing withLoadingState param.
inherited
executeStreamed(StreamFailureOr<DataState> function, {PreHandleData<DataState>? onDataReceived, PreHandleFailure? onFailureOccurred, bool withLoadingState = true, bool globalLoading = false, bool globalFailure = true}) Future<void>
Executes received stream function with additional parameters to control if loading state should be set while executing function by providing withLoadingState param. Usage is the same as the execute method with the main difference in number of function results (and consequently number of state updates) as it is a stream of data
inherited
initWithRef(Ref<Object?> ref) → void
inherited
initWithRefAndGetOrUpdateState(Ref<Object?> ref, BaseState<DataState> getOrUpdateState({BaseState<DataState>? newState})) → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
on<U>(AlwaysAliveProviderListenable<U> provider, void invokeFunction(U? previous, U next), {bool skipUpdateCondition(U? previous, U next)?}) → void
Subscribe to another notifier's state changes
inherited
setGlobalFailure(Failure? failure) → void
inherited
setGlobalInfo(GlobalInfo? globalInfo) → void
inherited
showGlobalLoading() → void
Show BaseLoadingIndicator above the entire app
inherited
throttle(Future<void> function(), {Duration duration = const Duration(milliseconds: 500), bool waitForFunction = true, String throttleIdentifier = ''}) Future<void>
Execute given function and then block further executing of the same function for certain duration. waitForFunction if set to true it will wait if function finishes after provided duration delay, otherwise will finish immediately after given duration
inherited
toString() String
A string representation of this object.
inherited
updateShouldNotify(BaseState<DataState> old, BaseState<DataState> current) bool
Whether to notify listeners or not when state changes
inherited

Operators

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