I'm making an implementation of PreferencesScreen
in Compose
and I've made all the components like PreferencesSwitch
, CheckBox
, etc.
Now I'm wondering if there is any way to make it so all the components can only be used inside the scope of the PreferencesScreen
function and cannot be used outside of it.
Like for example, in LazyColumn
, items
can only be used inside LazyColumnScope
. I looked at the implementation of it but it used the annotation @LazyScopeMarker
so I'm assuming there's different markers for different scopes?
Expected Behaviour:
PreferencesScreen{
PreferencesCheckBox(...){ ... }
}
is possible but,
PreferencesCheckBox(...){ ... }
alone is not possible.