Bottom Sheet using Jetpack Compose with Source Code

Опубликовано: 28 Сентябрь 2024
на канале: Pixel Developer
190
9

If you want to implement a bottom sheet, you can use the ModalBottomSheet composable.Programmatically expanding and collapsing the sheet is done using SheetState. You can use rememberSheetState to create an instance of SheetState that should be passed to ModalBottomSheet with the sheetState parameter. SheetState provides access to the show and collapse functions, as well as properties related to the current sheet state. These suspending functions require a CoroutineScope — for example, using rememberCoroutineScope — and can be called in response to UI events. Make sure to remove the ModalBottomSheet from composition upon hiding the bottom sheet.

Github Link - https://github.com/Dinesh2510