GenericReader extension Null safety

Adds the following methods to ConstantReader: get<T>(), getList<T>(), getSet<T>(), getMap<K, V>(), enumValue<T>(), holdsA<T>().

on

Methods

enumValue<T>() → T
Reads the instance of ConstantReader and returns an instance of T.
get<T>() → T
Reads the instance of ConstantReader and returns an instance of T.
getList<T>() List<T>
Reads the instance of ConstantReader and returns an instance of List<T>.
getMap<K, V>() Map<K, V>
Reads the instance of ConstantReader and returns an object of type Map<K, V>.
getSet<T>() Set<T>
Reads the instance of ConstantReader and returns an object of type Set<T>.
holdsA<T>() bool
Returns true if the instance of ConstantReader represents an object of type T.

Static Properties

registeredTypes Set<Type>
Returns a Set containing all types with registered decoders.
read-only

Static Methods

addDecoder<T>(Decoder<T> decoder) bool
Adds or updates a decoder function for type T.
clearDecoder<T>() → void
Clears the decoder function for type T.
hasDecoder<T>() bool
Returns true if a decoder function for dartType is registered.
isEnum<T>() bool
Returns true if T is a Dart enum.