FunctionType class

Represents a function type in Dart.

Function types describe the signature of functions, including their parameters, return type, and type parameters.

Inheritance

Constructors

FunctionType({required bool isNullable, required List<ParameterElement> parameters, List<TypeParameterType> typeParameters = const <TypeParameterType>[], required DartType returnType})
Creates a new FunctionType with the given properties.

Properties

element → Null
Return the element representing the declaration of this type, or null if the type is not associated with an element.
no setteroverride
hashCode → int
The hash code for this object.
no setteroverride
isClass → bool
Whether this type refers to a ClassElement.
no setterinherited
isDartAsyncFuture → bool
Return true if this type represents the type '{TYPE}' defined in the dart:async library. Return true if this type represents the type '{TYPE}' defined in the dart:async library.
no setterinherited
isDartAsyncFutureOr → bool
Return true if this type represents the type '{TYPE}' defined in the dart:async library.
no setterinherited
isDartAsyncStream → bool
Return true if this type represents the type '{TYPE}' defined in the dart:async library.
no setterinherited
isDartCoreBigInt → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreBool → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library. Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreDateTime → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreDouble → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreEnum → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreFunction → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreInt → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreIterable → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreList → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreMap → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreNull → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreNum → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreObject → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreRecord → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreSet → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreString → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreSymbol → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDartCoreType → bool
Return true if this type represents the type '{TYPE}' defined in the dart:core library.
no setterinherited
isDynamic → bool
Return true if this type represents the type 'dynamic'
no setterinherited
isEnum → bool
Whether this type refers to an EnumElement.
no setterinherited
isInvalid → bool
Return true if this type represents the type 'Invalid'
no setterinherited
isMixin → bool
Whether this type refers to a MixinElement.
no setterinherited
isNever → bool
Return true if this type represents the type 'Never'
no setterinherited
isNullable → bool
Whether this type is nullable.
finalinherited
isValid → bool
Returns whether this type is valid (not an invalidType).
no setterinherited
isVoid → bool
Return true if this type represents the type 'void'
no setterinherited
name → String?
returns the name of the type if it's a named type otherwise returns null
no setterinherited
namedParameterTypes → Map<String, DartType>
A map of named parameter names to their types.
no setter
normalParameterNames → List<String>
A list of names for required positional parameters.
no setter
normalParameterTypes → List<DartType>
A list of types for all required positional parameters.
no setter
optionalParameterNames → List<String>
A list of names for optional positional parameters.
no setter
optionalParameterTypes → List<DartType>
A list of types for all optional parameters (either positional or named).
no setter
parameters → List<ParameterElement>
The parameters of this function type.
final
returnType → DartType
The return type of this function type.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
typeParameters → List<TypeParameterType>
The type parameters of this function type.
final

Methods

instantiate(List<DartType> argumentTypes) → FunctionType
Creates a new function type by instantiating this generic function with the provided type arguments.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override
withNullability(bool isNullable) → FunctionType
Returns a copy of this function type with the specified nullability.
override

Operators

operator ==(Object other) → bool
The equality operator.
override