padding

Adds checked distances around the virtual child. The new behavior is appended inside the existing modifier chain. Measurement reports an ArithmeticException if a measured child extent plus the checked inset total overflows.

Return

this chain with one appended padding modifier.

Parameters

insets

the distances applied to each side.


Adds one distance around every side of the virtual child. The new behavior is appended inside the existing modifier chain.

Return

this chain with one appended padding modifier.

Parameters

all

the non-negative distance applied to every side.

Throws

when all is negative.

when twice all cannot be represented as an Int.


fun Modifier.padding(horizontal: Int, vertical: Int): Modifier(source)

Adds equal horizontal and equal vertical distances around the virtual child. The new behavior is appended inside the existing modifier chain.

Return

this chain with one appended padding modifier.

Parameters

horizontal

the non-negative distance applied to the left and right sides.

vertical

the non-negative distance applied to the top and bottom sides.

Throws

when either distance is negative.

when twice either distance cannot be represented as an Int.


fun Modifier.padding(left: Int = 0, top: Int = 0, right: Int = 0, bottom: Int = 0): Modifier(source)

Adds independently specified distances around the virtual child. Unspecified sides default to zero, and the new behavior is appended inside the existing modifier chain.

Return

this chain with one appended padding modifier.

Parameters

left

the non-negative distance applied to the left side.

top

the non-negative distance applied to the top side.

right

the non-negative distance applied to the right side.

bottom

the non-negative distance applied to the bottom side.

Throws

when any distance is negative.

when either axis total cannot be represented as an Int.