call method
Implementation
Future<CallResult> call(
String method, //
dynamic args,
{Duration? timeout}) async {
var call = PluginCall.unique(uid, method);
var msg = Message(MessageType.PLUGIN_CALL, call);
var rsp = await _intercom.sendWaitWhere(
msg,
Filters.every([
Filters.ofType([
MessageType.CALL_RESPONSE,
MessageType.CALL_NO_PLUGIN,
]),
_checkResultId(call.id)
]));
if (rsp.type == MessageType.CALL_NO_PLUGIN) throw PluginNotLoadedError(uid);
return CallResult.fromJson(assertTyped(rsp.content));
}