ParameterizedType class

A type that can track substituted type parameters, either for itself after instantiation, or from a surrounding context.

For example, given a class Foo<T>, after instantiation with S for T, it will track the substitution {S/T}.

This substitution will be propagated to its members. For example, say our Foo<T> class has a field T bar;. When we look up this field, we will get back a FieldElement that tracks the substituted type as {S/T}T, so when we ask for the field type we will get S.

Clients may not extend, implement or mix-in this class.

Implemented types
Implementers

Constructors

ParameterizedType()

Properties

displayName String
Return the name of this type as it should appear when presented to users in contexts such as error messages. [...]
@Deprecated('Use getDisplayString instead'), read-only, inherited
element Element
Return the element representing the declaration of this type, or null if the type has not, or cannot, be associated with an element. The former case will occur if the element model is not yet complete; the latter case will occur if this object represents an undefined type.
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
isBottom bool
Return true if this type represents the bottom type.
read-only, inherited
isDartAsyncFuture bool
Return true if this type represents the type 'Future' defined in the dart:async library.
read-only, inherited
isDartAsyncFutureOr bool
Return true if this type represents the type 'FutureOr
read-only, inherited
isDartCoreBool bool
Return true if this type represents the type 'bool' defined in the dart:core library.
read-only, inherited
isDartCoreDouble bool
Return true if this type represents the type 'double' defined in the dart:core library.
read-only, inherited
isDartCoreFunction bool
Return true if this type represents the type 'Function' defined in the dart:core library.
read-only, inherited
isDartCoreInt bool
Return true if this type represents the type 'int' defined in the dart:core library.
read-only, inherited
isDartCoreIterable bool
Returns true if this type represents the type 'Iterable' defined in the dart:core library.
read-only, inherited
isDartCoreList bool
Returns true if this type represents the type 'List' defined in the dart:core library.
read-only, inherited
isDartCoreMap bool
Returns true if this type represents the type 'Map' defined in the dart:core library.
read-only, inherited
isDartCoreNull bool
Return true if this type represents the type 'Null' defined in the dart:core library.
read-only, inherited
isDartCoreNum bool
Return true if this type represents the type 'num' defined in the dart:core library.
read-only, inherited
isDartCoreObject bool
Return true if this type represents the type Object defined in the dart:core library.
read-only, inherited
isDartCoreSet bool
Returns true if this type represents the type 'Set' defined in the dart:core library.
read-only, inherited
isDartCoreString bool
Return true if this type represents the type 'String' defined in the dart:core library.
read-only, inherited
isDartCoreSymbol bool
Returns true if this type represents the type 'Symbol' defined in the dart:core library.
read-only, inherited
isDynamic bool
Return true if this type represents the type 'dynamic'.
read-only, inherited
isObject bool
Return true if this type represents the type 'Object'.
@Deprecated('Use isDartCoreObject'), read-only, inherited
isVoid bool
Return true if this type represents the type 'void'.
read-only, inherited
name String
Return the name of this type, or null if the type does not have a name, such as when the type represents the type of an unnamed function.
@Deprecated('Check element, or use getDisplayString()'), read-only, inherited
nullabilitySuffix NullabilitySuffix
Return the nullability suffix of this type.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
typeArguments List<DartType>
Return the type arguments used to instantiate this type. [...]
read-only
typeParameters List<TypeParameterElement>
Return a list containing all of the type parameters declared for this type.
@Deprecated("Use ClassElement.typeParameters or FunctionType.typeFormals"), read-only

Methods

getDisplayString({bool withNullability = false}) String
Return the presentation of this type as it should appear when presented to users in contexts such as error messages. [...]
inherited
instantiate(List<DartType> argumentTypes) ParameterizedType
Return the type resulting from instantiating (replacing) the given argumentTypes for this type's bound type parameters.
@Deprecated("Use ClassElement.instantiate()")
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
resolveToBound(DartType objectType) DartType
If this type is a TypeParameterType, returns its bound if it has one, or objectType otherwise. [...]
inherited
substitute2(List<DartType> argumentTypes, List<DartType> parameterTypes) DartType
Return the type resulting from substituting the given argumentTypes for the given parameterTypes in this type. The specification defines this operation in section 2: [...]
@Deprecated(""" Use ClassElement.instantiate() or FunctionTypeAliasElement.instantiate() """), inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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