topMostYtoTarget static method
Implementation
static double topMostYtoTarget({
required double? top,
required double? bottom,
required double margin,
required Offset target,
required Size size,
required Size childSize,
}) {
double topmostYtoTarget;
if (top != null) {
topmostYtoTarget = top;
} else if (bottom != null) {
topmostYtoTarget = max(
size.topLeft(Offset.zero).dy + margin,
size.bottomRight(Offset.zero).dy - margin - childSize.height - bottom,
);
} else {
topmostYtoTarget = max(
margin,
min(
target.dy - childSize.height / 2,
size.bottomRight(Offset.zero).dy - margin - childSize.height,
),
);
}
return topmostYtoTarget;
}