Pablo
05/08/2026, 8:49 AMmutableStateOf for TextFields, booleans, etc.)
• callbacks that send the edited data back to the parent
Now I need the parent screen to pass the initial data of this large object down to each sub‑screen. The problem is that each sub‑screen has its own ViewModel with its own mutableStateOf fields, so those fields start out empty instead of being initialized with the parent’s data. My question is: what is the cleanest architecture for this scenario?
Option 1 Pass the initial object as a parameter to each sub‑screen and use a LaunchedEffect to push the initial values into the child ViewModel.
Option 2 Serialize the object to JSON, pass it through Navigation arguments, and let each child ViewModel read it from the SavedStateHandle. Whould be a very huge json.
Option 3 Allow the sub‑screens to access the parent ViewModel directly so they can read the initial data from there. This sounds rare. Each subscreen whould have two viewmodels.
Option 4 One single shared viewmodel for the parent screen and the subscreens. This is discarded, because the subscreens require an own viewmodel. They do have a lot of mutablestateof for the text fields, a lot of logic and stuff and edit a lot of components and mixing everything in a single viewmodels seems to be an error.
Which approach is the cleanest and most idiomatic?