https://kotlinlang.org logo
#compose
Title
# compose
k

Kazik

07/28/2022, 6:23 AM
Hi Guys. Is there any way to detect when bottom sheet is dismissed? For now I subscribe to navController’s current back stack entry flow inside bottom sheet, but it feels like hacky solution.
Copy code
LaunchedEffect(Unit) {
  navController.currentBackStackEntryFlow
    .filter { it.destination.route == parentRoute }
    .collect { onClose() }
}
j

jossiwolf

07/29/2022, 8:58 AM
What's your use case?
k

Kazik

07/29/2022, 9:21 AM
I want to know if user leave bottom sheet to cancel started action.
2 Views