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