Subclasses of RenderTwoDimensionalViewport will typically use firstChild to traverse children in a standard paint order that follows row or column major ordering. so we can customize the paint order. like this.
@override
void paint(PaintingContext context, Offset offset) {
// Paint as wish
var item = _visibleElements!.removeAt(0);
_visibleElements!.add(item);
for (final element in _visibleElements!) {
if (getChildFor(element.vicinity) case final child?) {
context.paintChild(child, parentDataOf(child).layoutOffset! + offset);
}
}
}

Subclasses of RenderTwoDimensionalViewport will typically use firstChild to traverse children in a standard paint order that follows row or column major ordering. so we can customize the paint order. like this.