I’m trying to create a custom layout, where childr...
# compose
b
I’m trying to create a custom layout, where children are placed in a new line if the odd space isn’t enough. Its a similar approach like the FlowRow in accompanist. https://gist.github.com/thebino/2d7385d5b3e51c036fa1873bac7b7ac7
c
Is there a question here?
or am i missing something? 😅
b
Yes, sorry. When using the open posted code in the gist. An error occured, saying the node was already placed. Chip 6 and others should be placed in a 2nd, 3rd or further rows instead of right.
c
does the accompanist code not work for you? or are you trying to write your own just for practice?
b
both 😸
c
Hm. I def have used flowRow and it 100% works as expected. let me dig up what im doing exactly.
Copy code
Column(Modifier.fillMaxSize().padding(horizontal = 16.dp)) {
    FlowRow(mainAxisSpacing = 8.dp, crossAxisSpacing = 8.dp) {
      allTags?.forEach {
        TextChip(
            text = it?.title!!,
            modifier =
                Modifier.clip(CircleShape)
                    .clickable { ... }
                    .padding(horizontal = 16.dp, vertical = 8.dp))
      }
    }
  }