INNER CODE UNIT · Kotlin

columnGap

IacobIonut01/ReFra · commonMain/androidx/compose/foundation/layout/Grid.kt:843

    override fun columnGap(gap: Dp) {
        require(gap.value >= 0f) { "Column gap must be non-negative" }
        columnGap = gap
    }

    override fun rowGap(gap: Dp) {
        require(gap.value >= 0f) { "Row gap must be non-negative" }
        rowGap = gap
    }
}

/**
 * A mutable state object representing a single child in the Grid throughout the layout lifecycle.
 *
 * This object is created once during the [resolveGridItemIndices] phase (containing only placement
 * info) and is reused and mutated during the [measureItems] phase to store the resulting
 * [Placeable] and calculation offsets. This significantly reduces object allocation per layout
 * pass.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…