showContextSwitcherBottomSheet function

void showContextSwitcherBottomSheet({
  1. required BuildContext context,
  2. required VooContextSwitcherConfig config,
  3. required ValueChanged<VooContextItem> onContextSelected,
})

Shows the context switcher as a bottom sheet modal.

This is the mobile-friendly presentation of the context switcher, providing a clean UI/UX for selecting contexts on mobile devices.

Implementation

void showContextSwitcherBottomSheet({
  required BuildContext context,
  required VooContextSwitcherConfig config,
  required ValueChanged<VooContextItem> onContextSelected,
}) {
  HapticFeedback.lightImpact();

  showModalBottomSheet(
    context: context,
    backgroundColor: Colors.transparent,
    isScrollControlled: true,
    builder: (context) => VooContextSwitcherBottomSheet(
      config: config,
      onContextSelected: onContextSelected,
    ),
  );
}