getMethodBySignature abstract method

Method? getMethodBySignature(
  1. String name,
  2. List<Class> parameterTypes
)

Gets a method by its name and parameter types.

Parameters:

  • name: The method name
  • parameterTypes: List of parameter types in exact order

Returns:

  • The exact method match if found
  • null if no matching signature exists

Example:

class Converter {
  String convert(int value) => value.toString();
  String convert(double value) => value.toString();
}

final method = Class.forType<Converter>()
  .getMethodBySignature('convert', [Class.forType<int>()]);

Implementation

Method? getMethodBySignature(String name, List<Class> parameterTypes);