skydoves / FlexibleBottomSheet

🐬 Advanced Compose Multiplatform bottom sheet for segmented sizing, non-modal type, and allows interaction behind the bottom sheet similar to Google Maps.
Apache License 2.0
687 stars 30 forks source link

Allow expansion to be skipped when the sheet is added #22

Closed docallaghanroku closed 4 weeks ago

docallaghanroku commented 4 months ago

Is your feature request related to a problem?

We'd like have the bottom sheet not automatically expand to intermediate height.

Describe the solution you'd like:

Add a new, optional parameter e.g. skipShow = false to the FlexibleBottomSheet constructor and use the parameter in the LaunchedEffect at the bottom of the file

if (!skipShow && sheetState.hasFullyExpandedState) {
        LaunchedEffect(sheetState) {
            sheetState.slightlyExpand()
        }
    }

Describe alternatives you've considered:

I've tried snapping to the desired target as a launched effect but it only works with a delay.

skydoves commented 4 weeks ago

Hey @docallaghanroku, this is not a recommended way to display/dismiss popups, as the bottom sheet will still display on your screen and occupy your UI resources. Instead, you can manage your own state by using the remember or rememberSaveable. Thank you!