InterfaceType class

The type introduced by either a class or an interface, or a reference to such a type.

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

Implemented types

Constructors

InterfaceType()

Properties

accessors → List<PropertyAccessorElement>
Return a list containing all of the accessors (getters and setters) declared in this type.
read-only
constructors → List<ConstructorElement>
Return a list containing all of the constructors declared in this type.
read-only
element ClassElement
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, override
interfaces → List<InterfaceType>
Return a list containing all of the interfaces that are implemented by this interface. Note that this is not, in general, equivalent to getting the interfaces from this type's element because the types returned by this method will have had their type parameters replaced.
read-only
methods → List<MethodElement>
Return a list containing all of the methods declared in this type.
read-only
mixins → List<InterfaceType>
Return a list containing all of the mixins that are applied to the class being extended in order to derive the superclass of this class. Note that this is not, in general, equivalent to getting the mixins from this type's element because the types returned by this method will have had their type parameters replaced.
read-only
superclass InterfaceType
Return the type representing the superclass of this type, or null if this type represents the class 'Object'. Note that this is not, in general, equivalent to getting the superclass from this type's element because the type returned by this method will have had it's type parameters replaced.
read-only
superclassConstraints → List<InterfaceType>
Return a list containing all of the super-class constraints that this mixin declaration declares. The list will be empty if this class does not represent a mixin declaration.
read-only
displayName → String
Return the name of this type as it should appear when presented to users in contexts such as error messages.
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' defined in the dart:async library.
read-only, inherited
isDartCoreBool → bool
Return true if this type represents the type 'bool' 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
isDartCoreNull → bool
Return true if this type represents the type 'Null' 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'.
read-only, inherited
isUndefined → bool
Return true if this type represents a typename that couldn't be resolved.
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.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
typeArguments → List<DartType>
Return a list containing the actual types of the type arguments. If this type's element does not have type parameters, then the array should be empty (although it is possible for type arguments to be erroneously declared). If the element has type parameters and the actual type does not explicitly include argument values, then the type "dynamic" will be automatically provided.
read-only, inherited
typeParameters → List<TypeParameterElement>
Return a list containing all of the type parameters declared for this type.
read-only, inherited

Methods

getGetter(String name) PropertyAccessorElement
Return the element representing the getter with the given name that is declared in this class, or null if this class does not declare a getter with the given name.
getMethod(String name) MethodElement
Return the element representing the method with the given name that is declared in this class, or null if this class does not declare a method with the given name.
getSetter(String name) PropertyAccessorElement
Return the element representing the setter with the given name that is declared in this class, or null if this class does not declare a setter with the given name.
instantiate(List<DartType> argumentTypes) InterfaceType
Return the type resulting from instantiating (replacing) the given argumentTypes for this type's bound type parameters.
override
isDirectSupertypeOf(InterfaceType type) → bool
Return true if this type is a direct supertype of the given type. The implicit interface of class I is a direct supertype of the implicit interface of class J iff: [...]
isMoreSpecificThan(DartType type) → bool
Return true if this type is more specific than the given type. An interface type T is more specific than an interface type S, written T « S, if one of the following conditions is met: [...]
override
isSubtypeOf(DartType type) → bool
Return true if this type is a subtype of the given type. An interface type T is a subtype of an interface type S, written T <: S, iff bottom/dynamicT « S (T is more specific than S). If an interface type I includes a method named call(), and the type of call() is the function type F, then I is considered to be a subtype of F.
override
lookUpConstructor(String name, LibraryElement library) ConstructorElement
Return the element representing the constructor that results from looking up the constructor with the given name in this class with respect to the given library, or null if the look up fails. The behavior of this method is defined by the Dart Language Specification in section 12.11.1: [...]
lookUpGetter(String name, LibraryElement library) PropertyAccessorElement
Return the element representing the getter that results from looking up the getter with the given name in this class with respect to the given library, or null if the look up fails. The behavior of this method is defined by the Dart Language Specification in section 12.15.1: [...]
lookUpGetterInSuperclass(String name, LibraryElement library) PropertyAccessorElement
Return the element representing the getter that results from looking up the getter with the given name in the superclass of this class with respect to the given library, or null if the look up fails. The behavior of this method is defined by the Dart Language Specification in section 12.15.1: [...]
lookUpInheritedGetter(String name, { LibraryElement library, bool thisType: true }) PropertyAccessorElement
Look up the member with the given name in this type and all extended and mixed in classes, and by default including thisType. If the search fails, this will then search interfaces. [...]
lookUpInheritedGetterOrMethod(String name, { LibraryElement library }) ExecutableElement
Look up the member with the given name in this type and all extended and mixed in classes, starting from this type. If the search fails, search interfaces. [...]
lookUpInheritedMethod(String name, { LibraryElement library, bool thisType: true }) MethodElement
Look up the member with the given name in this type and all extended and mixed in classes, and by default including thisType. If the search fails, this will then search interfaces. [...]
lookUpInheritedSetter(String name, { LibraryElement library, bool thisType: true }) PropertyAccessorElement
Look up the member with the given name in this type and all extended and mixed in classes, and by default including thisType. If the search fails, this will then search interfaces. [...]
lookUpMethod(String name, LibraryElement library) MethodElement
Return the element representing the method that results from looking up the method with the given name in this class with respect to the given library, or null if the look up fails. The behavior of this method is defined by the Dart Language Specification in section 12.15.1: [...]
lookUpMethodInSuperclass(String name, LibraryElement library) MethodElement
Return the element representing the method that results from looking up the method with the given name in the superclass of this class with respect to the given library, or null if the look up fails. The behavior of this method is defined by the Dart Language Specification in section 12.15.1: [...]
lookUpSetter(String name, LibraryElement library) PropertyAccessorElement
Return the element representing the setter that results from looking up the setter with the given name in this class with respect to the given library, or null if the look up fails. The behavior of this method is defined by the Dart Language Specification in section 12.16: [...]
lookUpSetterInSuperclass(String name, LibraryElement library) PropertyAccessorElement
Return the element representing the setter that results from looking up the setter with the given name in the superclass of this class with respect to the given library, or null if the look up fails. The behavior of this method is defined by the Dart Language Specification in section 12.16: [...]
substitute2(List<DartType> argumentTypes, List<DartType> parameterTypes) InterfaceType
Return the type resulting from substituting the given argumentTypes for the given parameterTypes in this type. The specification defines this operation in section 2: [...]
override
substitute4(List<DartType> argumentTypes) InterfaceType
Return the type resulting from substituting the given arguments for this type's parameters. This is fully equivalent to substitute2(argumentTypes, getTypeArguments()).
flattenFutures(TypeSystem typeSystem) DartType
Implements the function "flatten" defined in the spec, where T is this type: [...]
inherited
isAssignableTo(DartType type) → bool
Return true if this type is assignable to the given type. A type T may be assigned to a type S, written TS, iff either T <: S or S <: T.
inherited
isEquivalentTo(DartType dest) → bool
Indicates whether this represents a type that is equivalent to dest. [...]
inherited
isSupertypeOf(DartType type) → bool
Return true if this type is a supertype of the given type. A type S is a supertype of T, written S :> T, iff T is a subtype of S.
inherited
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
toString() → String
Returns a string representation of this object.
inherited

Operators

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

Static Methods

getSmartLeastUpperBound(InterfaceType first, InterfaceType second) InterfaceType
Returns a "smart" version of the "least upper bound" of the given types. [...]