packSignature method

String packSignature(
  1. String signature
)

Implementation

String packSignature(String signature) {
  if (lib == null) return "ERROR: The library is not initialized";

  final sig = signature.toNativeUtf8();
  //print("- Calling packSignature with argument: $sig");
  // The actual native call
  final resultPtr = _packSignature(sig);
  //print("- Result pointer:  $resultPtr");

  final result = resultPtr.toDartString();
  //print("- Response string:  $result");
  // Free the string pointer, as we already have
  // an owned String to return
  //print("- Freeing the native char*");
  cstringFree(resultPtr);
  return result;
}