Abhishek Dewan

    1 year ago
    Hi I am seeing something weird with the bottomSheetScaffold where the following scenario is leading to the bottom sheet not showing up. Starting with a collapsed state -> call expand on the bottomSheetState -> Do some work -> call collapse on the bottomSheetState -> call expand on the bottom sheet state again and the sheet doesn't expand. Upon debugging I do see that the bottomSheetState.isCollapsed is set to true before I call expand a second time. Also putting a debug pointer in the animateTo function the
    never collects. Am I doing something wrong here ?
    Fixed 😄
    Using compose beta06 at the moment
    I am dumb. Creating the bottomSheetScaffoldState needs to be done
    val scaffoldState = rememberBottomSheetScaffoldState(
        bottomSheetState = rememberBottomSheetState(initialValue = BottomSheetValue.Collapsed)
    instead of what I had earlier
    val scaffoldState = rememberBottomSheetScaffoldState(
        bottomSheetState = BottomSheetState(BottomSheetValue.Collapsed)