StreamViewModel< T> class
abstract
Provides functionality for a ViewModel that's sole purpose it is to fetch data using a Stream This class is mixed with mixins:
- Inheritance
-
- Object
- ChangeNotifier
- BaseViewModel
- ReactiveViewModel
- DynamicSourceViewModel<
T> - StreamViewModel
- Implemented types
- Mixed in types
Constructors
Properties
- anyObjectsBusy → bool
-
read-onlyinherited
- changeSource ↔ bool
-
read / writeinherited
- data ↔ T?
-
read / writeinherited
- dataReady → bool
-
Data is ready to be consumed
read-onlyinherited
- disposed ↔ bool
-
read / writeinherited
- hasError → bool
-
Returns the error existence status of the ViewModel
read-onlyinherited
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
read-onlyinherited
- hasMessage → bool
-
Returns the message status of the ViewModel
read-onlyinherited
- initialised → bool
-
read-onlyinherited
- isBusy → bool
-
Returns the busy status of the ViewModel
read-onlyinherited
-
listenableServices
→ List<
ListenableServiceMixin> -
read-onlyinherited
- modelError → dynamic
-
Returns the error status of the ViewModel
read-onlyinherited
- modelMessage → String?
-
Returns the message status of the ViewModel
read-onlyinherited
- onModelReadyCalled → bool
-
read-onlyinherited
-
reactiveServices
→ List<
ReactiveServiceMixin> -
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
-
stream
→ Stream<
T> -
Stream to listen to
read-only
- streamSubscription → StreamSubscription?
-
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
-
clearMessages(
) → void -
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 will throw after the object is disposed).
override
-
error(
Object object) → dynamic -
inherited
-
hasErrorForKey(
Object key) → bool -
Returns a boolean that indicates if the ViewModel has an error for the key
inherited
-
hasMessageForKey(
Object key) → bool -
Returns a boolean that indicates if the ViewModel has an message for the key
inherited
-
initialise(
) → void -
override
-
message(
Object object) → String? -
Returns the message for an object if it exists. Returns null if not present
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
notifySourceChanged(
{bool clearOldData = false}) → void -
override
-
onCancel(
) → void -
onData(
T? data) → void - Called before the notifyListeners is called when data has been set
-
onError(
dynamic error) → void - Called when an error is fired in the stream
-
onFutureError(
dynamic error, Object? key) → void -
Function that is called when a future throws an error
inherited
-
onSubscribed(
) → void - Called when the stream is listened too
-
rebuildUi(
) → void -
Calls the builder function with this updated viewmodel
inherited
-
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
-
setErrorForModelOrObject(
dynamic value, {Object? key}) → void -
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
-
setMessage(
String? message) → void -
Sets the message for the ViewModel
inherited
-
setMessageForObject(
Object object, String? value) → void -
Sets the message 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
-
setOnModelReadyCalled(
bool value) → void -
Sets the onModelReadyCalled value to true. This is called after this first onModelReady call
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(
T data) → T - Called before the data is set for the ViewModel
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited