Hi guys, is there any way to create a Builder patt...
# compose
m
Hi guys, is there any way to create a Builder pattern in compose (like what we have for the Modifier) that we can build our view by a builder and render it at last?
I don't want to use Slot since my base layout can be vary depends on use cases and blocks
z
Sure, nothing special about doing this. Just make your builder then call a composable with the builder result
m
But as I know compose draw layout immediately so if i create a builder it doesn't wait to build as once, am I right? Do you have a simple example? 🙏
z
Well you haven’t given a lot of info about how you want to use the builder. If you just want to use a builder to construct some configuration for a view, you can just use your builder from a parent composable.
If you can share an example of the code you want to be able to write, I can be more specific