SerdeType class

Serialization and deserialization utility type for constant values

Useful primarily for code generators which need to access annotation values in the build process.

Implementers
Annotations
  • @immutable

Constructors

SerdeType.enumV(List<Object?> values)
const
factory
SerdeType.late(SerdeType func())
const
factory
SerdeType.list(SerdeType generic)
const
factory
SerdeType.map(SerdeType genericKey, SerdeType genericValue)
const
factory
SerdeType.nested(Map<String, SerdeType> props)
const
factory
SerdeType.option(SerdeType generic)
const
factory
SerdeType.set(SerdeType generic)
const
factory
SerdeType.union(String discriminator, Map<String, SerdeType> variants)
const
factory
SerdeType.unionType(Set<SerdeType> variants)
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
inner String
no setter
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
toString() String
A string representation of this object.
override
when<T>({required T bool(), required T int(), required T num(), required T str(), required T option(SerdeTypeOption), required T duration(), required T list(SerdeTypeList), required T set(SerdeTypeSet), required T map(SerdeTypeMap), required T function(), required T nested(SerdeTypeNested), required T union(SerdeTypeUnion), required T unionType(SerdeTypeUnionType), required T enumV(SerdeTypeEnum<Object?>), required T dynamic(), required T late(SerdeTypeLate)}) → T
whenMaybe<T>({T bool()?, T int()?, T num()?, T str()?, T option(SerdeTypeOption)?, T duration()?, T list(SerdeTypeList)?, T set(SerdeTypeSet)?, T map(SerdeTypeMap)?, T function()?, T nested(SerdeTypeNested)?, T union(SerdeTypeUnion)?, T unionType(SerdeTypeUnionType)?, T enumV(SerdeTypeEnum<Object?>)?, T dynamic()?, T late(SerdeTypeLate)?, required T orElse()}) → T

Operators

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

Constants

bool → const SerdeType
duration → const SerdeType
dynamic → const SerdeType
function → const SerdeType
int → const SerdeType
num → const SerdeType
str → const SerdeType