Skip to Content
Forui 0.17.0 is released 🎉

Popover

A popover displays rich content in a portal that is aligned to a child.

CLI

To generate and customize this style:

dart run forui style create popover

Usage

FPopover(...)

FPopover( control: FPopoverControl.managed(), style: (style) => style.copyWith(...), constraints: const FPortalConstraints(), popoverAnchor: Alignment.topCenter, childAnchor: Alignment.bottomCenter, spacing: const FPortalSpacing(4), overflow: FPortalOverflow.flip, offset: Offset.zero, groupId: 'popover-group', hideRegion: FPopoverHideRegion.excludeChild, onTapHide: () {}, popoverBuilder: (context, controller) => const Placeholder(), builder: (context, controller, child) => const Placeholder(), child: const Placeholder(), );

Examples

Nested Popover

When placing widgets that use popovers internally, e.g. FSelect inside an FPopover, the outer popover will close when interacting with the inner widget’s dropdown. This happens because the inner dropdown is rendered in a separate overlay layer, and tapping it is considered “outside” the outer popover.

To prevent this, make both widgets share the same groupId.

Horizontal Alignment

You can change how the popover is aligned to the button.

Tapping Outside Does Not Close Popover

Blurred Barrier

Flip along Axis

The popover can be flipped along the overflowing axis to stay within the viewport boundaries.

Slide along Axis

The popover can be slid along the overflowing axis to stay within the viewport boundaries.

Allow Overflow

The popover is not shifted to stay within the viewport boundaries, even if it overflows.

Last updated on