Thread
#compose
    Karthick

    Karthick

    1 year ago
    I have a suggestion for ModalBottomSheetLayout, users should have explicitly pass sheet state. Because I called sheetState.show() without passing sheetState to ModalBottomSheetLayout because it has a default parameter value and getting exception
    Shakil Karim

    Shakil Karim

    1 year ago
    Yup, i use animateTo(Expanded)
    jim

    jim

    1 year ago
    I have a suggestion for ModalBottomSheetLayout, users should have explicitly pass sheet state. Because I called sheetState.show() without passing sheetState to ModalBottomSheetLayout because it has a default parameter value and getting exception
    Sorry, I'm not sure I understand, can you elaborate in more detail? You get an exception when you do not pass a state?
    Karthick

    Karthick

    1 year ago
    I forgat to pass the my own state to BottomSheet, but i call state.show(). So getting exception. Bottom sheet has default parameter value of state, Compile time check would pass.
    @Composable
    @ExperimentalMaterialApi
    fun ModalBottomSheetLayout(
        sheetContent: @Composable ColumnScope.() -> Unit,
        sheetState: ModalBottomSheetState =
      rememberModalBottomSheetState(ModalBottomSheetValue.Hidden),
        content: @Composable () -> Unit
    )
    val bottomSheet = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden)
    
    ModalBottomSheetLayout(
        sheetContent = {
            BottomSheetContent()
        }
    ) {
    Button(onClick = { bottomSheet.show() }){Text("Show Bottom Sheet")}
    }