PreconditionStatus class Null safety

Result of precondition check. Your precondition function should return one of two possible results:

PreconditionStatus.satisfied([Object data])
// test finished OK (and possible additional details)

PreconditionStatus.unsatisfied([Object data])
// test DIDN'T finished OK (and possible additional details)

There are few other possible statuses, but those are assigned automatically during the check and you are not supposed to use them as your return value. When reading the result state use convenient is-something methods: isSatisfied, isUnsatisfied, isFailed (test threw an exception), isUnknown (test wasn't run yet), isNotSatisfied (which means - anything else then satisfied).

Constructors

PreconditionStatus.fromBoolean(bool result, [Object? data])
Often you have a boolean value in your hands - use this constructor to create either PreconditionStatus.satisfied() (true) or PreconditionStatus.unsatisfied() (false).
factory
PreconditionStatus.satisfied([Object? data])
Test finished OK (and possible additional details). Return it as the result of your PreconditionFunction.
PreconditionStatus.unsatisfied([Object? data])
Test DIDN'T finished OK (and possible additional details). Return it as the result of your PreconditionFunction.

Properties

data Object?
Addition data about the result, use anyway you need.
final
hashCode int
The hash code for this object.
read-onlyinherited
isFailed bool
Convenient discriminator.
read-only
isNotSatisfied bool
Convenient discriminator. Please note, that it's not the same as 'isUnsatisfied'.
read-only
isSatisfied bool
Convenient discriminator.
read-only
isUnknown bool
Convenient discriminator.
read-only
isUnsatisfied bool
Convenient discriminator.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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