Function

asPaddingValues

Convert a WindowInsets to a PaddingValues and uses density for DP to pixel conversion.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

asPaddingValues

Common
fun WindowInsets.asPaddingValues(density: Density): PaddingValues

Convert a WindowInsets to a PaddingValues and uses density for DP to pixel conversion. PaddingValues can be passed to some containers to pad internal content so that it doesn't overlap the insets when fully scrolled. Ensure that the insets are consumed after the padding is applied if insets are to be used further down the hierarchy.