fromFunctionPointer static method

ObjCBlock<CGPoint Function(Pointer<Void>, CGPoint, Pointer<ObjCObject>)> fromFunctionPointer(
  1. Pointer<NativeFunction<CGPoint Function(Pointer<Void> arg0, CGPoint arg1, Pointer<ObjCObject> arg2)>> ptr
)

Creates a block from a C function pointer.

This block must be invoked by native code running on the same thread as the isolate that registered it. Invoking the block on the wrong thread will result in a crash.

Implementation

static objc.ObjCBlock<objc.CGPoint Function(ffi.Pointer<ffi.Void>, objc.CGPoint, ffi.Pointer<objc.ObjCObject>)>
fromFunctionPointer(
  ffi.Pointer<
    ffi.NativeFunction<
      objc.CGPoint Function(ffi.Pointer<ffi.Void> arg0, objc.CGPoint arg1, ffi.Pointer<objc.ObjCObject> arg2)
    >
  >
  ptr,
) => objc.ObjCBlock<objc.CGPoint Function(ffi.Pointer<ffi.Void>, objc.CGPoint, ffi.Pointer<objc.ObjCObject>)>(
  objc.newPointerBlock(_ObjCBlock_CGPoint_ffiVoid_CGPoint_idUICoordinateSpace_fnPtrCallable, ptr.cast()),
  retain: false,
  release: true,
);