computeHorizontalClamp function
Computes a horizontal correction (dx) that pulls the overlay back inside the
viewport when the resolved alignment would still place part of it off-screen
after computeEffectiveAlignment has already swapped the anchored side.
Returns 0 when the popover is already fully within the viewport.
Implementation
double computeHorizontalClamp({
required PopoverAlignment alignment,
required Offset triggerPosition,
required Size triggerSize,
required double popoverWidth,
required Size screenSize,
required Offset offset,
double margin = 8,
}) {
return _WPopoverState.computeHorizontalClamp(
alignment: alignment,
triggerPosition: triggerPosition,
triggerSize: triggerSize,
popoverWidth: popoverWidth,
screenSize: screenSize,
offset: offset,
margin: margin,
);
}