TypeLink class

An abstraction over pointing to a type in a given Dart source file.

In package:source_gen (and elsewhere) we sometimes refer to types by URL, such as dart:core#String. This breaks down once there is a generic type, such as List<String>.

TypeLink is a way to represent this type so it may be used for codegen.

Constructors

const

Properties

generics List<TypeLink>
Generic types, used to represent types such as List<String>.
final
hashCode int
The hash code for this object.
no setteroverride
import String?
Import path needed to refer to this type. May be null for none needed.
final
isDynamic bool
Whether this is considered dynamic.
no setter
isNullable bool
Whether this type is suffixed explicitly with ?.
final
isPrivate bool
Whether this is a private type.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
symbol String
Name of the symbol for the type, such as String.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
withoutGenerics() TypeLink
Returns as a TypeLink without generic type arguments.

Operators

operator ==(Object o) bool
The equality operator.
override

Constants

$dynamic → const TypeLink
Represents the type of dynamic (i.e. omitted type).
$null → const TypeLink
Represents the type of Null.
$object → const TypeLink
Represents the type of Object.
$void → const TypeLink
Represents the type of void.