MethodDeclarationImpl constructor

MethodDeclarationImpl({
  1. required CommentImpl? comment,
  2. required List<AnnotationImpl>? metadata,
  3. required Token? externalKeyword,
  4. required Token? modifierKeyword,
  5. required TypeAnnotationImpl? returnType,
  6. required Token? propertyKeyword,
  7. required Token? operatorKeyword,
  8. required Token name,
  9. required TypeParameterListImpl? typeParameters,
  10. required FormalParameterListImpl? parameters,
  11. 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);
}