MethodDeclarationImpl constructor
MethodDeclarationImpl({
- required CommentImpl? comment,
- required List<
AnnotationImpl> ? metadata, - required Token? externalKeyword,
- required Token? modifierKeyword,
- required TypeAnnotationImpl? returnType,
- required Token? propertyKeyword,
- required Token? operatorKeyword,
- required Token name,
- required TypeParameterListImpl? typeParameters,
- required FormalParameterListImpl? parameters,
- required FunctionBodyImpl body,
Initialize a newly created method declaration. Either or both of the
comment
and metadata
can be null
if the declaration does not have
the corresponding attribute. The externalKeyword can be null
if the
method is not external. The modifierKeyword can be null
if the method
is neither abstract nor static. The returnType
can be null
if no
return type was specified. The propertyKeyword can be null
if the
method is neither a getter or a setter. The operatorKeyword can be
null
if the method does not implement an operator. The parameters
must
be null
if this method declares a getter.
Implementation
MethodDeclarationImpl({
required super.comment,
required super.metadata,
required this.externalKeyword,
required this.modifierKeyword,
required TypeAnnotationImpl? returnType,
required this.propertyKeyword,
required this.operatorKeyword,
required this.name,
required TypeParameterListImpl? typeParameters,
required FormalParameterListImpl? parameters,
required FunctionBodyImpl body,
}) : _returnType = returnType,
_typeParameters = typeParameters,
_parameters = parameters,
_body = body {
_becomeParentOf(_returnType);
_becomeParentOf(_typeParameters);
_becomeParentOf(_parameters);
_becomeParentOf(_body);
}