dialog_provider

Function dialog_provider 

Source
pub fn dialog_provider(
    args: DialogProviderArgs,
    state: Arc<RwLock<DialogProviderState>>,
    main_content: impl FnOnce(),
    dialog_content: impl FnOnce(f32) + Send + Sync + 'static,
)
Expand description

A provider component that manages the rendering and event flow for a modal dialog.

This component should be used as one of the outermost layers of the application. It renders the main content, and when is_open is true, it overlays a modal dialog, intercepting all input events to create a modal experience.

The dialog can be closed by calling the on_close_request callback, which can be triggered by clicking the background scrim or pressing the ESC key.

ยงArguments

  • args - The arguments for configuring the dialog provider. See DialogProviderArgs.
  • main_content - A closure that renders the main content of the application, which is visible whether the dialog is open or closed.
  • dialog_content - A closure that renders the content of the dialog, which is only visible when args.is_open is true.