All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.huanshankeji.compose.foundation.layout.ext.BoxWithConstraints.kt Maven / Gradle / Ivy

Go to download

Common wrappers of components (including layouts) and styles for Compose Multiplatform on (desktop/Android and web)

The newest version!
package com.huanshankeji.compose.foundation.layout.ext

import androidx.compose.runtime.Composable
import androidx.compose.runtime.Stable
import androidx.compose.ui.unit.Dp
import com.huanshankeji.compose.foundation.ExperimentalFoundationApi
import com.huanshankeji.compose.foundation.layout.BoxScope
import com.huanshankeji.compose.ui.Alignment
import com.huanshankeji.compose.ui.Modifier

// copied and adapted from `androidx.compose.foundation.layout`

@ExperimentalFoundationApi
@Composable
//@UiComposable
expect fun BoxWithConstraints(
    modifier: Modifier = Modifier,
    contentAlignment: Alignment = Alignment.TopStart,
    //propagateMinConstraints: Boolean = false,
    content: @Composable /*@UiComposable*/ BoxWithConstraintsScope.() -> Unit
)

@Stable
interface BoxWithConstraintsScope : BoxScope {
    val maxWidth: Dp
    val maxHeight: Dp
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy