BaseChangeNotifier<T, E> class abstract

Inheritance

Constructors

BaseChangeNotifier()

Properties

busy bool
true, if the callback which was triggered in the run method is finished or not.
no setter
data ↔ T?
Get the provider data.
getter/setter pair
error ↔ E?
Get the provider error (typically a DioError type).
getter/setter pair
hasData bool
Whether the provider at some point has data.
no setter
hasError bool
Whether the provider at some point has error.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
onData ↔ void Function(T data)?
getter/setter pair
onError ↔ void Function(E? error)?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state ProviderState
Get the provider state which is either loading or idle
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
clear() → void
Sets data and error to null.
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
idle() → void
Calling idle() will set the state to ProviderState.idle if the loadingType is stateLoading, otherwise it will call the onHideFullScreenLoadingDialog() method in order to hide any fullscreen loading dialog.
loading() → void
Calling loading() will set the state to ProviderState.loading which then notify all listeners.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onHideFullScreenLoadingDialog() → void
Must be implemented if the loadingType is set to loadingType.fullScreenLoading in order to hide the fullscreen loading dialog.
onShowFullScreenLoadingDialog() → void
Must be implemented if the loadingType is set to loadingType.fullScreenLoading in order to show a fullscreen loading dialog.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
run(Future<void> callback(), {int? loadingType = LoadingType.stateLoading}) Future<void>
An async method that triggers an async callback (typically process) which sets the provider in its selected state.
toString() String
A string representation of this object.
inherited

Operators

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