I have a composable function:
@Composable
fun GapText(
modifier: Modifier,
text: String,
) {
Row(modifier = modifier) {
Text(text = text)
...
}
}
Now I want to create a modifier that only GapText can use:
fun Modifier.customTag(tag: String) =
this then CustomTag(tag)
But with this function that I wrote every composable function can use it. What should I do?
As of now there's no specific modifier for this, but what one could do is:
1 - Declare the Composable on a separated file and make the modifier private:
2 - Declare the modifier function within the Composable: