DartType class abstract
Base class representing a Dart type in the type system.
This is the foundation for all types in Dart, including primitive types, interface types, function types, and special types.
- Implementers
Constructors
- DartType.new()
-
A const constructor for DartType.
const
Properties
- element → Element?
-
Return the element representing the declaration of this type, or
null
if the type is not associated with an element.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- isClass → bool
-
Whether this type refers to a ClassElement.
no setter
- isDartAsyncFuture → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:async library. Returntrue
if this type represents the type '{TYPE}' defined in the dart:async library.no setter - isDartAsyncFutureOr → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:async library.no setter - isDartAsyncStream → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:async library.no setter - isDartCoreBigInt → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreBool → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library. Returntrue
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreDateTime → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreDouble → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreEnum → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreFunction → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreInt → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreIterable → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreList → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreMap → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreNull → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreNum → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreObject → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreRecord → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreSet → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreString → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreSymbol → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDartCoreType → bool
-
Return
true
if this type represents the type '{TYPE}' defined in the dart:core library.no setter - isDynamic → bool
-
Return
true
if this type represents the type 'dynamic'no setter - isEnum → bool
-
Whether this type refers to an EnumElement.
no setter
- isInvalid → bool
-
Return
true
if this type represents the type 'Invalid'no setter - isMixin → bool
-
Whether this type refers to a MixinElement.
no setter
- isNever → bool
-
Return
true
if this type represents the type 'Never'no setter - isNullable → bool
-
Whether this type is nullable.
no setter
- isValid → bool
-
Returns whether this type is valid (not an invalidType).
no setter
- isVoid → bool
-
Return
true
if this type represents the type 'void'no setter - name → String?
-
returns the name of the type if it's a named type
otherwise returns null
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withNullability(
bool isNullable) → DartType - Returns a copy of this type with the specified nullability.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- dynamicType → const DynamicType
-
The predefined type representing
{TYPE}
. - invalidType → const InvalidType
-
The predefined type representing
{TYPE}
. - neverType → const NeverType
-
The predefined type representing
{TYPE}
. - unknownInferredType → const UnknownInferredType
-
The predefined type representing
{TYPE}
. - voidType → const VoidType
-
The predefined type representing
{TYPE}
. The predefined type representing{TYPE}
.