Sample project to demonstrate how to have clear and better interactions between composables and viewmodels.
- uiState concept to maintain the state for our composables inside view model and update the UI composables based on the state changes.
- shared flow to fire events for result and displays toast message from composable.
- launched effect to handle state change happening outside of the composable but in the same scope.
If you want to read more in detail, please read here: https://saurabhpant.medium.com/cleaner-way-to-interact-between-composable-and-viewmodel-in-jetpack-compose-14c8b3a74bbe