static ffi.Pointer<ffi.Void> toPointer(Rect? val) { if (val == null) { return ffi.nullptr; } final result = malloc.call<RectNative>(); result.ref = toNative(val); return result.cast(); }