# invokeMethod<T> abstract method

Object? invokeMethod<T>(

1. T instance,
2. String method, {
3. List<Object?> args = const [],
4. Map<String, Object?> namedArgs = const {},

})

Invokes a method `method` on the given `instance` of type `T`.

- `instance`: The object on which to invoke the method.
- `method`: The name of the method to invoke.
- `args`: Positional arguments for the method.
- `namedArgs`: Named arguments for the method.

Returns the result of the method invocation, or `null` if the method returns `void`. Throws an UnImplementedResolverException if the method cannot be resolved.

## Implementation

    Object? invokeMethod<T>(T instance, String method, {List<Object?> args = const [], Map<String, Object?> namedArgs = const {}});