getMethod method
Returns a class method by its name.
If a method with the specified name is not found, returns null.
name - The name of the method to find.
Return value:
MethodDeclaration?: The method with the given name, ornullif not found.
Implementation
MethodDeclaration? getMethod(String name) =>
classMembers.firstWhereOrNull(
(ClassMember node) =>
node is MethodDeclaration && node.name.lexeme == name,
)
as MethodDeclaration?;