invoke static method

dynamic invoke(
  1. dynamic instance,
  2. MethodMirror method,
  3. List params, [
  4. Map<String, dynamic>? namedArgs,
])

Invoke a method of the specified instance.

  • instance - the object instance.
  • method - the method
  • params - the positional + optional parameters.
  • namedArgs - the optional named arguments. Ignored if the method is a getter or setter.

Implementation

static invoke(instance, MethodMirror method, List params,
    [Map<String, dynamic>? namedArgs])
  => invokeByMirror(reflect(instance), method, params, namedArgs);