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
s
Shakil Karim
02/12/2021, 5:32 AM
Yup, i use animateTo(Expanded)
j
jim
02/12/2021, 8:55 AM
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?
k
Karthick
02/12/2021, 1:59 PM
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.
Copy code
@Composable
@ExperimentalMaterialApi
fun ModalBottomSheetLayout(
sheetContent: @Composable ColumnScope.() -> Unit,
sheetState: ModalBottomSheetState =
rememberModalBottomSheetState(ModalBottomSheetValue.Hidden),
content: @Composable () -> Unit
)