DefaultFormalParameter class

A formal parameter with a default value.

There are two kinds of parameters that are both represented by this class: named formal parameters and positional formal parameters.

defaultFormalParameter ::= name ('=' AstNode)?

defaultNamedParameter ::= name (':' AstNode)?

Implemented types

Constructors

DefaultFormalParameter(String? _name, AstRuntimeNode? _defaultValue, bool? _isNamed, bool? _isPositional, bool? _isOptional, bool? _isOptionalNamed, bool? _isOptionalPositional)

Properties

defaultValue AstRuntimeNode?
no setter
hashCode int
The hash code for this object.
no setterinherited
isNamed bool?
Return true if this parameter is a named parameter.
no setteroverride
isOptional bool?
Return true if this parameter is an optional parameter.
no setteroverride
isOptionalNamed bool?
Return true if this parameter is both an optional and named parameter.
no setteroverride
isOptionalPositional bool?
Return true if this parameter is both an optional and positional parameter.
no setteroverride
isPositional bool?
Return true if this parameter is a positional parameter.
no setteroverride
name String?
Return the name of the parameter being declared.
no setteroverride
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

Operators

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

Static Methods

fromAst(Map? ast) DefaultFormalParameter?