GenericReader extension
Adds the following methods to ConstantReader
:
get<T>()
, getList<T>()
, getSet<T>()
, getMap<K, V>()
,
holdsA<T>()
.
- on
-
- ConstantReader
Methods
-
get<
T> () → T -
Reads the
ConstantReader
instance and returns an instance ofT
. -
getDynamic(
) → dynamic -
Reads a constant with type
dynamic
. -
getList<
T> () → List< T> -
Reads the
ConstantReader
instance and returns an instance ofList<T>
. -
getMap<
K, V> () → Map< K, V> -
Reads
constantReader
and returns an object of typeMap<K, V>
. -
getSet<
T> () → Set< T> -
Reads the
ConstantReader
instance and returns an object of typeSet<T>
. -
holdsA<
T> () → bool -
Returns
true
if the instance ofConstantReader
represents an object of typeT
.
Static Properties
- info → String
-
no setter
-
registeredTypes
→ Set<
Type> -
Returns a
Set
containing all types with registered decoders.no setter -
resolvedTypes
→ Set<
Type> -
Returns a
Set
containing all types previously resolved from a static type.no setter
Static Methods
-
addDecoder<
T> (Decoder< T> decoder) → bool -
Adds or updates a decoder function for type
T
. Returnstrue
if the decoder was added. -
clearDecoder<
T> () → void -
Clears the decoder function for type
T
. -
hasDecoder<
T> () → bool -
Returns
true
if a decoder function for typeT
is registered. -
isBuiltIn(
Type T) → bool - Decoders for (exactly) these types cannot be registered or cleared.
-
isEnum<
T> () → bool -
Returns
true
ifT
is a Dartenum
. -
isMatch(
DartType? dartType, Type type) → bool -
Returns true if
dartType
represents the typetype
. -
resolveType(
DartType? dartType) → Type -
Returns a type
Type
that matchesdartType
and instance ofDartType
.