Hey Good Morning. I am using ModalTransition Dialo...
# compose
s
Hey Good Morning. I am using ModalTransition Dialog, which has some content That needs to be Center Vertical on Screen So I am using Box (with attributes Fill Max size and positioning the Small Card inside ModalTransitionDialog inside it) But to this the Dialog is not respecting the on outside click dismiss attribute. The portion which catch the UI event for dismissing the dialog on outside click is occupied by box so that I can align the ui element inside. How to resolve this ?? So as to make on dismiss click outside work Code Looks Like
Copy code
Dialog(
        onDismissRequest = {
            coroutineScope.launch {
                startDismissWithExitAnimation(animateContentBackTrigger, onDismiss)
            }
        },
        properties = DialogProperties(
            usePlatformDefaultWidth = false,
            dismissOnBackPress = dismissOnBackPress,
            dismissOnClickOutside = dismissOnClickOutside
        )
    ) {
        Box(
            modifier = Modifier
                .fillMaxSize() // Required in order to occupy the whole screen before the animation is triggered
                .also {
                    if (dismissOnClickOutside) {
                        it.clickable {
                            //TODO add on dismiss request
                        }
                    }
                },
            contentAlignment = contentAlignment
        ) {
            AnimatedModalBottomSheetTransition(visible = animateContentBackTrigger.value) {
                content(ModalTransitionDialogHelper(coroutineScope, onCloseSharedFlow))
            }
        }
    }
}