isDisplayingChildInSliver static method
Determines whether the target child widget is being displayed
Implementation
static bool isDisplayingChildInSliver({
required RenderBox? targetChild,
required double showingChildrenMaxOffset,
required double scrollViewOffset,
required Axis scrollDirection,
double toNextOverPercent = 1,
}) {
if (targetChild == null) {
return false;
}
if (!isBelowOffsetWidgetInSliver(
scrollViewOffset: scrollViewOffset,
scrollDirection: scrollDirection,
targetChild: targetChild,
toNextOverPercent: toNextOverPercent,
)) {
return false;
}
final parentData = targetChild.parentData;
if (parentData is! SliverMultiBoxAdaptorParentData) {
return false;
}
final targetChildLayoutOffset = parentData.layoutOffset ?? 0;
return targetChildLayoutOffset < showingChildrenMaxOffset;
}