
Our simple application will contain only 2 screens (one topbar and only text as content). Note: In this article, we will not focus to write pretty UI for simplicity. After refactoring, there was a huge difference and less code. The same way can be done for different scopes Column, Row, etc. One usage can be to reuse the TopBar in Compose app without having to rewrite TopBar for each screen. I came up with a solution (we’ll implement it soon). I didn’t see examples online or find a solution so went into the source code of the layouts and start reading. I just realized that I’m rewriting the same lines of code for each screen and I started to search for a solution.

I was looking for a way to write a composable function that takes content as a parameter and didn’t see many examples of that.
