invoke<T> method

Future<T?> invoke<T>([
  1. dynamic args
])

Native method invocation definition and handling.

Implementation

Future<T?> invoke<T>([dynamic args]) async {
  if (argumentType != null && args.runtimeType != argumentType!) {
    throw Exception('Argument type not properly defined for $this. Expected $argumentType, got ${args.runtimeType}.');
  }
  if (args is IaBaseRequest) {
    args = args.toSupportedType();
  }
  return await channel.invokeMethod(methodId, args);
}