How to use `Divider` as vertical line?
# compose
k
How to use
Divider
as vertical line?
p
I am not sure, but inside the RowScope, it becomes vertical
k
It didn't so thought we need to do something to get it working for vertical line
p
Hi, for this purpose i have created dedicated composable
Copy code
@Composable
fun AppDividerVertical(
  modifier: Modifier = Modifier,
  color: Color = MaterialTheme.colors.onSurface.copy(alpha = 0.12f),
  thickness: Dp = 1.dp,
  startIndent: Dp = 0.dp,
) {
  val indentMod = if (startIndent.value != 0f) {
    Modifier.padding(top = startIndent)
  } else {
    Modifier
  }
  Box(
    modifier.then(indentMod)
        .fillMaxHeight()
        .preferredWidth(thickness)
        .background(color = color)
    )
}
👍 4