isReachOffsetWidgetInSliver static method
Determines whether the target child widget has reached the specified offset
Implementation
static bool isReachOffsetWidgetInSliver({
required double scrollViewOffset,
required Axis scrollDirection,
required RenderBox targetChild,
double toNextOverPercent = 1,
}) {
if (!isBelowOffsetWidgetInSliver(
scrollViewOffset: scrollViewOffset,
scrollDirection: scrollDirection,
targetChild: targetChild,
toNextOverPercent: toNextOverPercent,
)) return false;
final parentData = targetChild.parentData;
if (parentData is! SliverMultiBoxAdaptorParentData) {
return false;
}
final targetFirstChildOffset = parentData.layoutOffset ?? 0;
return scrollViewOffset >= targetFirstChildOffset;
}