MethodDeclaration class

A method declaration.

methodDeclaration ::= methodSignature FunctionBody

methodSignature ::= 'external'? ('abstract' | 'static')? Type? ('get' | 'set')? methodName TypeParameterList FormalParameterList

methodName ::= SimpleIdentifier | 'operator' SimpleIdentifier

Prior to the 'extension-methods' experiment, these nodes were always children of a class declaration. When the experiment is enabled, these nodes can also be children of an extension declaration.

Implemented types

Constructors

MethodDeclaration(String? name, FormalParameterList? parameterList, FunctionBody? body, TypeName? returnType, bool? isGetter, bool? isSetter)

Properties

body FunctionBody?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isGetter bool?
getter/setter pair
isSetter bool?
getter/setter pair
name String?
getter/setter pair
parameterList FormalParameterList?
getter/setter pair
returnType TypeName?
getter/setter pair
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) MethodDeclaration?