bottom_sheet_provider

Function bottom_sheet_provider 

Source
pub fn bottom_sheet_provider(
    args: BottomSheetProviderArgs,
    state: Arc<RwLock<BottomSheetProviderState>>,
    main_content: impl FnOnce() + Send + Sync + 'static,
    bottom_sheet_content: impl FnOnce() + Send + Sync + 'static,
)
Expand description

Renders a bottom sheet UI group, managing its animation, scrim, and content.

This is the main function for creating a bottom sheet. It should be called within a component that manages the application’s state.

§Arguments

  • args: Configuration options, including the style and close request handler. See BottomSheetProviderArgs.
  • state: The shared state object that controls whether the sheet is open or closed. See BottomSheetProviderState.
  • main_content: A closure that renders the primary UI content, which is always visible behind the sheet.
  • bottom_sheet_content: A closure that renders the content of the sheet itself. It receives a f32 argument representing the current animation progress (alpha), which can be used to fade content in and out.