TypeDefinition class

Contains information about the type of fields, arguments and return values.

Constructors

TypeDefinition({required String className, List<TypeDefinition> generics = const [], required bool nullable, String? url, DartType? dartType, bool customClass = false, EnumSerialization? serializeEnum})
TypeDefinition.fromDartType(DartType type)
Creates an TypeDefinition from a given DartType. throws FromDartTypeClassNameException if the class name could not be determined.
factory
TypeDefinition.mixedUrlAndClassName({required String mixed, List<TypeDefinition> generics = const [], required bool nullable, bool customClass = false})
Creates an TypeDefinition from mixed where the url and className is separated by ':'.
factory

Properties

asNullable → TypeDefinition
Get this TypeDefinition, but nullable.
no setter
className → String
The class name of the type.
final
columnType → String
Get the Column extending class name representing this TypeDefinition.
no setter
customClass → bool
True if this type references a custom class.
final
dartType → DartType?
final
databaseType → String
Get the qgsql type that represents this TypeDefinition in the database.
no setter
databaseTypeEnum → String
Get the enum name of the ColumnType, representing this TypeDefinition in the database.
no setter
generics → List<TypeDefinition>
The generics the type has.
final
hashCode → int
The hash code for this object.
no setterinherited
isEnumType → bool
no setter
isIdType → bool
no setter
isListType → bool
no setter
isMapType → bool
no setter
isModuleType → bool
no setter
isSerializedByExtension → bool
no setter
isSerializedValue → bool
no setter
moduleAlias → String?
no setter
nullable → bool
Whether this type is nullable.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
serializeEnum ↔ EnumSerialization?
getter/setter pair
url → String?
final

Methods

applyProtocolReferences(List<SerializableModelDefinition> classDefinitions) → TypeDefinition
Applies protocol references. This makes the protocol: prefix optional. First, the protocol definition is parsed, then it's check for the protocol: prefix in types. Whenever no url is set and user specified a class/enum with the same symbol name it defaults to the protocol: prefix.
generateDeserialization(bool serverCode, {required GeneratorConfig config}) → List<MapEntry<Expression, Code>>
Generates the constructors for List and Map types
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reference(bool serverCode, {bool? nullable, List<String> subDirParts = const [], required GeneratorConfig config, String? typeSuffix}) → TypeReference
Generate a TypeReference from this definition.
stripFuture() → TypeDefinition
Strip the outer most future of this type. Throws, if this type is not a future.
toString() → String
A string representation of this object.
override

Operators

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

Static Properties

int ↔ TypeDefinition
A convenience variable for getting a TypeDefinition of an non null int quickly.
getter/setter pair