Hey Everyone ! I try to generate UI with Compose based on Json, but I'm struggling with assigning scope specific modifiers like
weight
which are only available within Row and Column scopes. Is there dynamic way of telling composables that they are currently in a specific scope? I tried utilizing
context(RowScope)
annotation for methods, but that requires me to create a method for each scope. Is there any better flexible way?
Basically
if( parent is Row) { add 'weight' to current composable }
Thank you 🙏
🚫 1
✅ 1
e
Elliot Murray
05/20/2024, 9:10 AM
Do you have a code sample of where you're trying to get the row scope?
if(this is RowScope)
should work?
f
Fin
05/20/2024, 12:52 PM
Thx for your attempt to help Elliot. I was able to find a workaround that worked so far by passing down a Modifier to its children. Let me share some sample code