ProviderModelBatch class

A batch of changes to a ProviderModel. Changes made to ProviderModelVariables will not be reflected until commit is called.

If cancel is called, all changes made to ProviderModelVariables will be discarded.

If commit is called, all changes made to ProviderModelVariables will be applied, and notifyListeners will be called for anyone listening to the ProviderModel or any ProviderModelVariables.

A batch can be created by calling ProviderModel.begin or ProviderModel.lock.

Properties

completed bool
Whether this batch is complete or not. A batch is completed once commit or cancel is called.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
valid bool
Whether this batch is valid or not. A batch is valid from the time it is created forever unless cancel is called or the batch was disabled by overridding or other means.
no setter

Methods

blockOverride<R>(FutureOr<R> f()) Future<R>
Prevent execution of f to be overridden and cancelled by a ProviderModel.lock call.
cancel() → void
Cancel this batch. Once cancelled, all changes made to ProviderModelVariables will be discarded.
commit({bool? notify}) → void
Commit this batch. Once committed, all changes made to ProviderModelVariables will be applied.
get<T>(ProviderModelVariable<T> container) → T
Get the value of a ProviderModelVariable in this batch. If the value has not been set in this batch, the actual value of the variable will be returned via ProviderModelVariable.unsafeValue.
isSet<T>(ProviderModelVariable<T> container) bool
Whether a ProviderModelVariable has been set itself or in this batch.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set<T>(ProviderModelVariable<T> container, T value) → void
Set the value of a ProviderModelVariable in this batch. All subsequent calls to get will return value instead of the ProviderModelVariable.unsafeValue of the variable.
toString() String
A string representation of this object.
inherited

Operators

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