InterfaceType class abstract

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.
no setter
alias InstantiatedTypeAliasElement?
If this type is an instantiation of a type alias, information about the alias element, and the type arguments. Otherwise return null.
no setterinherited
aliasArguments List<DartType>?
If this type is an instantiation of a type alias, return the type arguments used for the instantiation. Otherwise return null.
no setterinherited
aliasElement TypeAliasElement?
If this type is an instantiation of a type alias, return it. Otherwise return null.
no setterinherited
allSupertypes List<InterfaceType>
Return all the super-interfaces implemented by this interface. This includes superclasses, mixins, interfaces, and superclass constraints.
no setter
constructors List<ConstructorElement>
Return a list containing all of the constructors declared in this type.
no setter
displayName String
Return the name of this type as it should appear when presented to users in contexts such as error messages.
no setterinherited
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.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
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.
no setter
isBottom bool
Return true if this type represents the bottom type.
no setterinherited
isDartAsyncFuture bool
Return true if this type represents the type 'Future' defined in the dart:async library.
no setterinherited
isDartAsyncFutureOr bool
Return true if this type represents the type 'FutureOr
no setterinherited
isDartCoreBool bool
Return true if this type represents the type 'bool' defined in the dart:core library.
no setterinherited
isDartCoreDouble bool
Return true if this type represents the type 'double' defined in the dart:core library.
no setterinherited
isDartCoreFunction bool
Return true if this type represents the type 'Function' defined in the dart:core library.
no setterinherited
isDartCoreInt bool
Return true if this type represents the type 'int' defined in the dart:core library.
no setterinherited
isDartCoreIterable bool
Returns true if this type represents the type 'Iterable' defined in the dart:core library.
no setterinherited
isDartCoreList bool
Returns true if this type represents the type 'List' defined in the dart:core library.
no setterinherited
isDartCoreMap bool
Returns true if this type represents the type 'Map' defined in the dart:core library.
no setterinherited
isDartCoreNull bool
Return true if this type represents the type 'Null' defined in the dart:core library.
no setterinherited
isDartCoreNum bool
Return true if this type represents the type 'num' defined in the dart:core library.
no setterinherited
isDartCoreObject bool
Return true if this type represents the type Object defined in the dart:core library.
no setterinherited
isDartCoreSet bool
Returns true if this type represents the type 'Set' defined in the dart:core library.
no setterinherited
isDartCoreString bool
Return true if this type represents the type 'String' defined in the dart:core library.
no setterinherited
isDartCoreSymbol bool
Returns true if this type represents the type 'Symbol' defined in the dart:core library.
no setterinherited
isDynamic bool
Return true if this type represents the type 'dynamic'.
no setterinherited
isVoid bool
Return true if this type represents the type 'void'.
no setterinherited
methods List<MethodElement>
Return a list containing all of the methods declared in this type.
no setter
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.
no setter
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.
no setterinherited
nullabilitySuffix NullabilitySuffix
Return the nullability suffix of this type.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
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.
no setter
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.
no setter
typeArguments List<DartType>
Return the type arguments used to instantiate this type.
no setterinherited

Methods

accept<R>(TypeVisitor<R> visitor) → R
Use the given visitor to visit this type.
inherited
acceptWithArgument<R, A>(TypeVisitorWithArgument<R, A> visitor, A argument) → R
Use the given visitor to visit this type.
inherited
asInstanceOf(ClassElement element) InterfaceType?
Return the canonical interface that this type implements for element, or null if such an interface does not exist.
inherited
getDisplayString({required bool withNullability}) String
Return the presentation of this type as it should appear when presented to users in contexts such as error messages.
inherited
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.
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:
lookUpGetter2(String name, LibraryElement library, {bool concrete = false, bool inherited = false, bool recoveryStatic = false}) PropertyAccessorElement?
Return the getter with the given name.
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:
lookUpMethod2(String name, LibraryElement library, {bool concrete = false, bool inherited = false, bool recoveryStatic = false}) MethodElement?
Return the method with the given name.
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:
lookUpSetter2(String name, LibraryElement library, {bool concrete = false, bool inherited = false, bool recoveryStatic = false}) PropertyAccessorElement?
Return the setter with the given name.
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:
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent 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
A string representation of this object.
inherited

Operators

operator ==(Object 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.