getChildOffsetInSliverList function
Get child offset from sliver list
Implementation
double? getChildOffsetInSliverList(
BuildContext sliverContext,
BuildContext childContext,
) {
assert(sliverContext is SliverMultiBoxAdaptorElement);
AbstractNode? childRO = childContext.findRenderObject();
while (childRO != null) {
if (childRO is RenderIndexedSemantics) break;
childRO = childRO.parent;
}
assert(childRO is RenderIndexedSemantics, "seems child is not a list item");
final sliverRO = (sliverContext as SliverMultiBoxAdaptorElement).renderObject;
return sliverRO.childScrollOffset(childRO as RenderIndexedSemantics);
}