resume method

  1. @override
ProgressResult resume(
  1. int handle,
  2. String valueJson
)
override

Resumes with a JSON-encoded return valueJson.

Implementation

@override
ProgressResult resume(int handle, String valueJson) {
  final ptr = Pointer<ffi_native.MontyHandle>.fromAddress(handle);
  final cValue = valueJson.toNativeUtf8().cast<Char>();
  final outError = calloc<Pointer<Char>>();

  try {
    final tag = ffi_native.monty_resume(ptr, cValue, outError);

    return _buildProgressResult(ptr, tag, outError.value);
  } finally {
    calloc
      ..free(cValue)
      ..free(outError);
  }
}