you can do patterns like that with both component ...
# compose
l
you can do patterns like that with both component classes and composable functions, if that was what you were asking
s
You can show an example of how it can be done with functions?
l
Depends on what you’re wanting to do, but for instance a real naive version of the above could be done like the following
Copy code
@Composable fun Scaffold(
  builder: ScaffoldScope.() -> Unit) {
  val scope = ScaffoldScope()
  scope.builder()
  // ... use `scope`
  scope.bodyComposable()
}
class ScaffoldScope(var bodyComposable: ...) {
  fun body(composable: @Composable() () -> Unit)  { bodyComposable = composable; }
}