Deepak Gahlot

    Deepak Gahlot

    1 year ago
    So i'm using a ModalBottomSheetLayout inside an LazyColumn. The Modalsheet comes up on the button click which is one of the item of the LazyColumn. And i'm getting this error
    java.lang.IllegalStateException: Nesting scrollable in the same direction layouts like ScrollableContainer and LazyColumn is not allowed.
    is this something i need to take care while using the ModalBottomSheet inside a LazyColumn
    Also, it looks like we cannot use a BottomSheet as well from within the LazyList Item
    @Andrey Kulikov any thoughts on this
    Andrey Kulikov

    Andrey Kulikov

    1 year ago
    why do you add BottomSheet inside LazyColumn? BottomSheet can’t be put inside the scrollable container as it is scrollable on its own.
    your main content like the LazyColumn should be defined where “Text(“Rest of the UI”)” is defined in the sample
    Deepak Gahlot

    Deepak Gahlot

    1 year ago
    Okay i see how this is supposed to be implemented. Is there any other component which i can use instead of modalsheet/bottomsheet
    i guess we can use Dialogs can be used anything else which i might be missing ?
    jossiwolf

    jossiwolf

    1 year ago
    ModalBottomSheetLayout is what you wanna go for if you're building a UI with a bottom sheet, dialogs serve a bit of a different purpose
    Deepak Gahlot

    Deepak Gahlot

    1 year ago
    But i guess even the ModalBottomSheetLayout would not work within a lazyColumm
    I just need to implememt a Mutiselect list, i was using a dialog to show it, but our UX teams had a different idea to show that 😇
    jossiwolf

    jossiwolf

    1 year ago
    I think you might have the responsibilities switched up - the ModalBottomSheetLayout is a container that wraps whatever body content you might have in order to layout correctly and make things swipeable. The ModalBottomSheetLayout doesn't work within a lazy column because it uses the swipeable modifier. The
    LazyColumn
    (or whatever you want to use for your list) would go into the ModalBottomSheet's
    sheetContent
    slot, all the body content would go into the
    content
    slot. Think of a ModalBottomSheetLayout a bit like a CoordinatorLayout - you wouldn't host that in a list either.
    Deepak Gahlot

    Deepak Gahlot

    1 year ago
    Thank you explaining this. Now i know how it is supposed to be implemented