79514090

Date: 2025-03-17 09:12:42
Score: 0.5
Natty:
Report link

What you have written works well without any issues.

But I recommend using collectAsStateWithLifecycle() instead of collectAsState() since the latter is not lifecycle-aware.

For a smoother UI, wrap your composable with AnimatedVisibility instead of using a simple if statement.

AnimatedVisibility(show) {
    Text (text = "ExampleScreen", fontSize = 16.sp)
}
Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): What you have
  • Low reputation (0.5):
Posted by: Vishnu S Dharan