TypedLazy<T extends Object?> class abstract base

Base class for lazy evaluation of a typed value.

Same as Lazy, but with subsequent conversion of Object? to T using the convert method.

If the value already has type T, the convert method will not be called!

Important

When the value is converted, the original resolved object is released: after reading value, the resolved getter returns the converted value.

Inheritance
Implementers

Constructors

TypedLazy(Object? unresolved)
Creates a lazy typed value from a direct value or a function computing it.
TypedLazy.resolved(T resolved)
Creates a lazy typed value from an already resolved value of type T.

Properties

hashCode int
The hash code for this object.
no setterinherited
resolved Object?
The resolved value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T
The resolved value converted to T.
no setter

Methods

convert(Object? resolved) → T
Converts a resolved value whose type does not match T.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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