fromPointer static method

Error? fromPointer(
  1. Pointer<Void> ptr, {
  2. bool needFree = true,
})

Implementation

static Error? fromPointer(Pointer<Void> ptr, {bool needFree = true}) {
  if (ptr == nullptr) {
    return null;
  }
  final result = ErrorImpl.fromNative(ptr.cast<ErrorNative>().ref);
  if (needFree) {
    malloc.free(ptr);
  }
  return result;
}