getMethodsByName abstract method

List<Method> getMethodsByName(
  1. String name
)

Gets all methods with a specific name.

Parameters:

  • name: The method name to filter by

Returns:

  • List of all overloads with this name
  • Empty list if no matches found

Example:

class Overloader {
  void test(int a) {}
  void test(String s) {}
}

final overloads = Class.forType<Overloader>().getMethodsByName('test');
print(overloads.length); // 2

Implementation

List<Method> getMethodsByName(String name);