paintOrder method

Widget paintOrder(
  1. int paintOrder, [
  2. Key? key
])

Sets the paint order for this widget within its parent container.

Paint order determines the z-index stacking order of children. Widgets with higher paint order values are painted later (appear on top).

The optional key parameter assigns a key to the wrapped widget.

Example:

Text('Background').paintOrder(0),
Text('Foreground').paintOrder(10),

Implementation

Widget paintOrder(int paintOrder, [Key? key]) {
  return _WidgetWrapper._wrapOrCopyWith(
    child: this,
    key: key != null ? () => key : null,
    paintOrder: () => paintOrder,
  );
}