childrenInPaintOrder property Null safety

Iterable<RenderSliver> childrenInPaintOrder
override

Provides an iterable that walks the children of the viewport, in the order that they should be painted.

This should be the reverse order of childrenInHitTestOrder.

Implementation

@override
Iterable<RenderSliver> get childrenInPaintOrder sync* {
  if (firstChild == null)
    return;
  RenderSliver? child = firstChild;
  while (child != center) {
    yield child!;
    child = childAfter(child);
  }
  child = lastChild;
  while (true) {
    yield child!;
    if (child == center)
      return;
    child = childBefore(child);
  }
}