data class object1()
data class object2()
In my @Composable screen I have 2 tabs, every single display a list with items.
when (tabToDisplay) {
TabCategory.1-> Section1(list = listOf<object1>())
TabCategory.2-> Section2(list = listOf<object2>())
}
@Section1
and @Section2
is the same composable with
Column(){
list.forEach {
UiItem1()
//or
UiItem2()
}
}
The only difference inside is the type of item I'm creating.
Question:
How I can simplify my code to have only 1 @Composable
section for my list object