toPropertyAccessorElement method
Converts this method element to a property accessor element.
This is used when a method needs to be treated as a getter or setter, typically for code generation purposes or to adapt a method's interface.
@param isGetter Whether the accessor is a getter @param isSetter Whether the accessor is a setter @return A property accessor element based on this method
Implementation
PropertyAccessorElementImpl toPropertyAccessorElement({
required bool isGetter,
required bool isSetter,
}) {
return PropertyAccessorElementImpl(
name: name,
isAbstract: isAbstract,
isAsynchronous: isAsynchronous,
isExternal: isExternal,
isGenerator: isGenerator,
isOperator: isOperator,
isStatic: isStatic,
isSynchronous: isSynchronous,
enclosingElement: enclosingElement,
isGetter: isGetter,
isSetter: isSetter,
);
}