call<T> method

Future<T> call<T>(
  1. String method, [
  2. List<Object?> args = const []
])

Implementation

Future<T> call<T>(String method, [List<Object?> args = const []]) async {
  if (_destroyed) throw invalidState('destroyed');
  final handler = _handlers[method];
  if (handler == null) throw invalidState('unknown_method', {'method': method});
  return (await handler(args)) as T;
}