Precondition class Null safety

PreconditionsRepository creates this object from PreconditionFunction which you register in PreconditionsRepository.registerPrecondition(). Think of it as a handle to your precondition. It is a mutable ChangeNotifier, but is modified only through methods of PreconditionsRepository and from your point of view is read-only. It's possible to integrate it with your state management tool, for example:

Precondition pHandle = repository.registerPrecondition( ... );
// ...
AnimatedBuilder(
    animation: pHandle,
    builder: (context, _) => pHandle.build(context),
);
Inheritance

Properties

dependenciesStrategy DependenciesStrategy?
final
dependsOn Iterable<PreconditionId>
final
description String?
final
hashCode int
The hash code for this object.
read-onlyoverride
hasListeners bool
Whether any listeners are currently registered.
@protectedread-onlyinherited
id PreconditionId
Identification of this precondition. Supply your own or it will be assigned by the repository.
final
isFailed bool
Convenient discriminator.
read-only
isNotSatisfied bool
Convenient discriminator. Please note, that it's not the same as 'isUnsatisfied'.
read-only
isRunning bool
Is running right now.
read-only
isSatisfied bool
Convenient discriminator.
read-only
isUnknown bool
Convenient discriminator.
read-only
isUnsatisfied bool
Convenient discriminator.
read-only
lastEvaluation DateTime?
Last evaluation run was finished at ...
read-only
notSatisfiedCache Duration
For how long should we cache negative (unsatisfiend and failed) test results. Might be usefull in cases when the test itself is expensive, failed results don't spontaneously change that often etc.
final
preconditionFunction PreconditionFunction
Implementation of precondition test you supplied.
final
resolveTimeout Duration
Specify a timeout for your PreconditionFunction. After this period test is evaluated as "failed". Default value is 10 seconds. Because all test are executed simultaneously, we can say that "evaluation" method in PreconditionsRepository will run for maximum duration equal to maximum timeout among all executed tests.
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
satisfiedCache Duration
For how long should we cache positive test results. Might be usefull in cases when the test itself is expensive, positive results don't spontaneously change that often etc.
final
status PreconditionStatus
Current (equals last) result of evaluation, which happened at lastEvaluation.
read-only
statusBuilder StatusBuilder
Widget builder of this precondition.
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
build(BuildContext context) Widget
Builds a widget with status description. Uses statusBuilder supplied in PreconditionsRepository.registerPrecondition.
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).
@mustCallSuperinherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() String
A string representation of this object.
override
toStringDebug() String

Operators

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