targetContentOffsetForProposedContentOffset method

NSPoint targetContentOffsetForProposedContentOffset(
  1. NSPoint proposedContentOffset, {
  2. required NSPoint withScrollingVelocity,
})

targetContentOffsetForProposedContentOffset:withScrollingVelocity:

Implementation

NSPoint targetContentOffsetForProposedContentOffset(
  NSPoint proposedContentOffset, {
  required NSPoint withScrollingVelocity,
}) {
  objc.checkOsVersionInternal(
    'NSCollectionViewLayout.targetContentOffsetForProposedContentOffset:withScrollingVelocity:',
    iOS: (true, null),
  );
  final _ptr = pkg_ffi.calloc<NSPoint>();
  objc.useMsgSendVariants
      ? _objc_msgSend_1td6if0Stret(
          _ptr,
          this.ref.pointer,
          _sel_targetContentOffsetForProposedContentOffset_withScrollingVelocity_,
          proposedContentOffset,
          withScrollingVelocity,
        )
      : _ptr.ref = _objc_msgSend_1td6if0(
          this.ref.pointer,
          _sel_targetContentOffsetForProposedContentOffset_withScrollingVelocity_,
          proposedContentOffset,
          withScrollingVelocity,
        );
  final _finalizable = _ptr.cast<ffi.Uint8>().asTypedList(
    ffi.sizeOf<NSPoint>(),
    finalizer: pkg_ffi.calloc.nativeFree,
  );
  return ffi.Struct.create<NSPoint>(_finalizable);
}