getParentChildObstructionExtent method

ChildObstructionExtent getParentChildObstructionExtent()

Returns the total child obstruction extent of all slivers above and this render object.

Implementation

ChildObstructionExtent getParentChildObstructionExtent() {
  var childObstructionExtent =
      ChildObstructionExtent(leading: 0, trailing: 0);
  var parent = this.parent;
  while (parent != null && parent is! RenderViewport) {
    if (parent is RenderSliver) {
      final geometry = parent.geometry;
      if (geometry?.childObstructionExtent != null) {
        childObstructionExtent += geometry!.childObstructionExtent!;
      }
    }
    parent = parent.parent;
  }
  return childObstructionExtent;
}