Hey composers, like i have one createScreen compos...
# compose
a
Hey composers, like i have one createScreen composable I added this composable to BottomSheetContent, now when i done the opereation inside CreateScreen , i dissmiss the bottom sheet , when i reopen that sheet I found in last statge of CreateScreen, basically i want the initial state of CreateScreen when i reopen
m
Keep in mind, bottom sheets are composed along with the parent container (BottomSheetScaffold). Dismissing the bottom sheet does not actually cause the sheet content to be removed from the composition. As such, any "remember" you use inside it's content will remember the state when you bring it up again. You will need to reset the state whenever the bottom sheet is dismissed. The reason for this is that one of the use cases for BottomSheetScaffold is having a persistent bottom sheet (ie, a sheet with a non zero peek height). As a result, the scaffold always keeps the composition in the tree, but it will be off screen, by altering it's y offset
At least that's my understanding of it anyway.
a
@mattinger got your point thanks