Identity class
An Identity exists solely to return the specified argument Status from
its update()
method. An Identity compares equal to another Identity if
they are both constructed with the same Status.
Example:
void identityExample() {
final success = const Identity(Status.success);
// always returns the specified Status
assert(success.update() == Status.success);
assert(success.update() == Status.success);
final otherSuccess = Identity(Status.success);
// two instances with the same Status compare as equal
assert(success == otherSuccess);
assert(success.update() == otherSuccess.update());
}
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
) → Status -
override
Operators
-
operator ==(
Object rhs) → bool -
The equality operator.
override