wintersoldier
02/15/2023, 11:55 AMval bottomsheetState =
rememberModalBottomSheetState(
initialValue = ModalBottomSheetValue.Hidden,
confirmStateChange = {false}
)
Is there a workaround.Tin Tran
02/16/2023, 3:44 AMwintersoldier
02/16/2023, 3:47 AMTin Tran
02/16/2023, 3:55 AMwintersoldier
02/16/2023, 3:58 AMTin Tran
02/16/2023, 4:00 AMwintersoldier
02/16/2023, 4:01 AMTin Tran
02/16/2023, 4:05 AMcomposable("/a){}
bottomSheet("/b"){}
You can do this
composable("/a)
{
val bottomsheetState =
rememberModalBottomSheetState(
initialValue = ModalBottomSheetValue.Hidden,
confirmStateChange = {
// your logic
}
BottomSheetModalLayout{
}
}
wintersoldier
02/16/2023, 4:06 AMTin Tran
02/16/2023, 4:09 AMonDismiss = {
if (sheetState.confirmStateChange(Hidden)) {
scope.launch { sheetState.hide() }
}
},
But you can’t override it in the case of bottom sheet navigator because it has to do some synchronization to control the state of the back stack