runJSONRPCRequest static method

Future runJSONRPCRequest(
  1. Callback callback,
  2. String request, [
  3. String? cardId,
  4. Message? initialMessage,
])

Implementation

static Future runJSONRPCRequest(
    Callback callback,
    String request, [
      String? cardId,
      Message? initialMessage,
    ]) async {
  final valuesToExport = <String, dynamic>{"JSONRPCRequest": request};
  if (cardId != null) valuesToExport["cardId"] = cardId;
  if (initialMessage != null) valuesToExport["initialMessage"] = initialMessage.toJson();

  _channel
      .invokeMethod("runJSONRPCRequest", valuesToExport)
      .then((result) => callback.onSuccess(result))
      .catchError((error) => _sendBackError(callback, error));
}