Faysal Hossain
05/28/2024, 10:40 PMval scaffoldState = rememberBottomSheetScaffoldState(
bottomSheetState = SheetState(
skipPartiallyExpanded = false,
density = LocalDensity.current, initialValue = SheetValue.PartiallyExpanded,
skipHiddenState = true
)
)
val isKeyboardOpen = rememberIsKeyboardOpen().value
val pricingDataExists = pricingData.value != null
val targetHeight = if (isKeyboardOpen || !pricingDataExists) 0.dp else 163.dp
val animateHeight by animateDpAsState(
targetValue = targetHeight,
animationSpec = tween(
durationMillis = 100,
easing = LinearOutSlowInEasing
), label = ""
)
BottomSheetScaffold(
scaffoldState = scaffoldState,
modifier = Modifier.fillMaxSize(),
sheetContent = {
RegistrationBottomSheetContent(navigator, pricingData.value)
},
sheetTonalElevation = 30.dp,
sheetPeekHeight = 163.dp,
sheetContainerColor = sheetContainerColor,
sheetContentColor = MaterialTheme.colorScheme.onSurface,
containerColor = MaterialTheme.colorScheme.surface,
sheetShadowElevation = 10.dp,
sheetDragHandle = {
Box(
modifier = Modifier
.fillMaxWidth()
.height(32.dp)
.background(MaterialTheme.colorScheme.surface),
contentAlignment = Alignment.Center
) {
Box(
modifier = Modifier
.width(98.dp)
.height(4.dp)
.background(HeyJomGrey, CircleShape)
)
}
},
sheetSwipeEnabled = true
) {
RegistrationFormContent(
navigator = navigator,
eventRegiViewModel = eventRegiViewModel
)
}