Having in mind a form with 10 fields (for instance) of different types (text, radio button, checkbox, combobox, … ).
What do you folks think is the best approach?
1️⃣ Expose one `Flow`/`LiveData`
for each field in ViewModel and collect/observe them individually in the screen.
2️⃣ Expose one
State
for each field in ViewModel and simply access them from the screen.
3️⃣ Encapsulate these 10 fields in a
data class, expose one single `Flow`/`LiveData` and each “setter” create a
copy
of this data class instance to update the state.
4️⃣ Encapsulate these 10 fields in a
data class, each field is a
state, ViewModel has an instance of this class and you simply access it from the screen.
5️⃣ Other (please explain)