MultipleStreamViewModel class Null safety

Provides functionality for a ViewModel to run and fetch data using multiple streams

Inheritance
Implemented types

Constructors

MultipleStreamViewModel()

Properties

anyObjectsBusy bool
read-only, inherited
changeSource bool
read / write, inherited
dataMap Map<String, dynamic>?
read-only, inherited
disposed bool
read-only, inherited
hasError bool
Returns the error status of the ViewModel
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
hasListeners bool
Whether any listeners are currently registered. [...]
@protected, read-only, inherited
initialised bool
read-only, inherited
isBusy bool
Returns the busy status of the ViewModel
read-only, inherited
modelError → dynamic
Returns the error status of the ViewModel
read-only, inherited
onModelReadyCalled bool
read-only, inherited
reactiveServices List<ReactiveServiceMixin>
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
streamsMap Map<String, StreamData>
read-only
streamsSubscriptions Map<String, StreamSubscription>?
@visibleForTesting, read-only

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes. [...]
inherited
busy(Object? object) bool
Returns the busy status for an object if it exists. Returns false if not present
inherited
clearErrors() → void
Clears all the errors
inherited
dataReady(String key) bool
inherited
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 and removeListener will throw after the object is disposed). [...]
@mustCallSuper, override
error(Object object) → dynamic
inherited
getSubscriptionForKey(String key) StreamSubscription?
Returns the stream subscription associated with the key
hasErrorForKey(Object key) bool
Returns a boolean that indicates if the ViewModel has an error for the key
inherited
initialise() → void
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
notifyListeners() → void
Call all the registered listeners. [...]
inherited
notifySourceChanged({bool clearOldData = false}) → void
override
onCancel(String key) → void
onData(String key, dynamic data) → void
onError(String key, dynamic error) → void
onFutureError(dynamic error, Object? key) → void
Function that is called when a future throws an error
inherited
onSubscribed(String key) → void
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes. [...]
inherited
runBusyFuture<T>(Future<T> busyFuture, {Object? busyObject, bool throwException = false}) Future<T>
Sets the ViewModel to busy, runs the future and then sets it to not busy when complete. [...]
inherited
runErrorFuture<T>(Future<T> future, {Object? key, bool throwException = false}) Future<T>
inherited
setBusy(bool value) → void
Marks the ViewModel as busy and calls notify listeners
inherited
setBusyForObject(Object? object, bool value) → void
Sets the busy state for the object equal to the value passed in and notifies Listeners If you're using a primitive type the value SHOULD NOT BE CHANGED, since Hashcode uses == value
inherited
setError(dynamic error) → void
Sets the error for the ViewModel
inherited
setErrorForObject(Object object, dynamic value) → void
Sets the error state for the object equal to the value passed in and notifies Listeners If you're using a primitive type the value SHOULD NOT BE CHANGED, since Hashcode uses == value
inherited
setInitialised(bool value) → void
Sets the initialised value for the ViewModel to true. This is called after the first initialise special ViewModel call
inherited
setOnModelReadyCalled(bool value) → void
Sets the onModelReadyCalled value to true. This is called after this first onModelReady call
inherited
setupStream<T>(Stream<T> stream, {dynamic onData, dynamic onSubscribed, dynamic onError, dynamic onCancel, dynamic transformData}) StreamData
@protected, inherited
skeletonData<T>({required T? realData, required T busyData, Object? busyKey}) → T
returns real data passed if neither the model is busy nor the object passed is busy
inherited
toString() String
A string representation of this object. [...]
inherited
transformData(String key, dynamic data) → dynamic

Operators

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