-
Notifications
You must be signed in to change notification settings - Fork 5
Customize the paint order. #3
Copy link
Copy link
Open
Description
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);
}
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
