along static method

Offset along(
  1. Size view,
  2. FPortalTarget target,
  3. FPortalFollower follower
)

Shifts the follower along the target's edge if the follower overflows out of the viewport.

Implementation

static Offset along(Size view, FPortalTarget target, FPortalFollower follower) {
  final anchor = none(view, target, follower).translate(target.offset.dx, target.offset.dy);

  final viewBox = Offset.zero & view;
  final followerBox = anchor & follower.size;

  return _along(anchor, viewBox, followerBox).translate(-target.offset.dx, -target.offset.dy);
}