invokeMethod method Null safety

dynamic invokeMethod(
  1. dynamic obj,
  2. String name,
  3. List args
)

Invokes an object method by its name with specified parameters.

  • obj an object to invoke.
  • name a name of the method to invoke.
  • args a list of method arguments. Returns the result of the method invocation or null if method returns void.