Jimmy
06/26/2021, 5:00 PMjim
06/26/2021, 5:05 PMvectorIcon
and a String
, and have the button be responsible for emitting the appropriate child widgets, instead of taking in a generic children lambda which is relatively unconstrained.Colton Idle
06/26/2021, 5:09 PMJimmy
06/26/2021, 5:10 PMColton Idle
06/26/2021, 5:11 PMJimmy
06/26/2021, 5:15 PMTimo Drick
06/29/2021, 2:18 PMinterface RestrictedContentScope {
@Composable fun CompanyButton()
@Composable fun CompanyText()
}
@Composable
fun RestrictedContent(content: RestrictedContentScope.() -> Unit) {
val scope = object : RestrictedContentScope {
override fun CompanyButton() {
Button(onClick = {}) {
//...
}
}
override fun CompanyText() {
Text("")
}
}
content(scope)
}
Please note that the content is not a composable so it is here restricted to use custom composables.