childrenInHitTestOrder property Null safety

Iterable<RenderSliver> childrenInHitTestOrder
override

Provides an iterable that walks the children of the viewport, in the order that hit-testing should use.

This should be the reverse order of childrenInPaintOrder.

Implementation

@override
Iterable<RenderSliver> get childrenInHitTestOrder {
  final List<RenderSliver> children = <RenderSliver>[];
  if (firstChild == null)
    return children;
  RenderSliver? child = center;
  while (child != null) {
    children.add(child);
    child = childAfter(child);
  }
  child = childBefore(center!);
  while (child != null) {
    children.add(child);
    child = childBefore(child);
  }
  return children;
}