PopoverConfiguration<T> class
OverlayConfiguration that presents its content as a popover.
On mobile platforms, adaptiveConversion converts this into a
DrawerConfiguration sliding up from the bottom, matching the historical
default behavior of showPopover under ShadcnLayer. Pass
adaptive: false to showOverlay (or call show directly) to always get
a real popover regardless of platform.
While shown, OverlayController can update this overlay in place (new alignment, margin, etc.) by assigning a new PopoverConfiguration to the live overlay's OverlayCompleter.config.
- Inheritance
-
- Object
- OverlayConfiguration<
T> - PopoverConfiguration
Constructors
-
PopoverConfiguration({Anchor? anchor, required AlignmentGeometry alignment, required WidgetBuilder builder, Offset? position, AlignmentGeometry? anchorAlignment, PopoverConstraint widthConstraint = PopoverConstraint.flexible, PopoverConstraint heightConstraint = PopoverConstraint.flexible, Key? key, bool rootOverlay = true, bool modal = true, bool barrierDismissable = true, Clip clipBehavior = Clip.none, Object? regionGroupId, Offset? offset, AlignmentGeometry? transitionAlignment, EdgeInsetsGeometry? margin, bool follow = true, bool consumeOutsideTaps = true, ValueChanged<
PopoverOverlayWidgetState> ? onTickFollow, bool allowInvertHorizontal = true, bool allowInvertVertical = true, bool dismissBackdropFocus = true, Duration? showDuration, Duration? dismissDuration, OverlayBarrier? overlayBarrier, OverlayHandler? handler}) -
Creates a PopoverConfiguration.
const
Properties
- alignment → AlignmentGeometry
-
Popover alignment relative to the anchor.
final
- allowInvertHorizontal → bool
-
Whether horizontal inversion is allowed when space is constrained.
final
- allowInvertVertical → bool
-
Whether vertical inversion is allowed when space is constrained.
final
- anchor → Anchor?
-
The Anchor to position/track against (LinkedAnchor for an anchor
key registered via OverlayAnchor, or ContextAnchor), if using
anchor-based positioning instead of the BuildContext passed to show.
final
- anchorAlignment → AlignmentGeometry?
-
Anchor alignment point.
final
- barrierDismissable → bool
-
Whether tapping the barrier dismisses the popover.
final
- builder → WidgetBuilder
-
Builds the popover content.
final
- clipBehavior → Clip
-
Clipping behavior for the popover content.
final
- consumeOutsideTaps → bool
-
Whether outside taps are consumed.
final
- dismissBackdropFocus → bool
-
Whether to dismiss when backdrop gains focus.
final
- dismissDuration → Duration?
-
Dismiss animation duration.
final
- follow → bool
-
Whether the popover follows the anchor if it moves.
final
- handler → OverlayHandler?
-
Explicit OverlayHandler override. If null, resolves the ambient
OverlayManager at show time.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- heightConstraint → PopoverConstraint
-
Height constraint mode.
final
- key → Key?
-
Widget key for the popover overlay.
final
- margin → EdgeInsetsGeometry?
-
Popover margin.
final
- modal → bool
-
Whether the popover is modal.
final
- offset → Offset?
-
Additional position offset.
final
-
onTickFollow
→ ValueChanged<
PopoverOverlayWidgetState> ? -
Callback invoked on every follow tick.
final
- overlayBarrier → OverlayBarrier?
-
Custom barrier configuration.
final
- position → Offset?
-
Explicit position, overrides alignment if provided.
final
- regionGroupId → Object?
-
Region grouping identifier.
final
- rootOverlay → bool
-
Whether to use the root overlay.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showDuration → Duration?
-
Show animation duration.
final
- transitionAlignment → AlignmentGeometry?
-
Transition origin alignment.
final
- widthConstraint → PopoverConstraint
-
Width constraint mode.
final
Methods
-
adaptiveConversion(
BuildContext context) → OverlayConfiguration< T> -
Returns an equivalent configuration adapted for the current platform,
e.g. a PopoverConfiguration becomes a DrawerConfiguration on mobile.
override
-
copyWith(
{ValueGetter< Anchor?> ? anchor, ValueGetter<AlignmentGeometry> ? alignment, ValueGetter<WidgetBuilder> ? builder, ValueGetter<Offset?> ? position, ValueGetter<AlignmentGeometry?> ? anchorAlignment, ValueGetter<PopoverConstraint> ? widthConstraint, ValueGetter<PopoverConstraint> ? heightConstraint, ValueGetter<Key?> ? key, ValueGetter<bool> ? rootOverlay, ValueGetter<bool> ? modal, ValueGetter<bool> ? barrierDismissable, ValueGetter<Clip> ? clipBehavior, ValueGetter<Object?> ? regionGroupId, ValueGetter<Offset?> ? offset, ValueGetter<AlignmentGeometry?> ? transitionAlignment, ValueGetter<EdgeInsetsGeometry?> ? margin, ValueGetter<bool> ? follow, ValueGetter<bool> ? consumeOutsideTaps, ValueGetter<ValueChanged< ? onTickFollow, ValueGetter<PopoverOverlayWidgetState> ?>bool> ? allowInvertHorizontal, ValueGetter<bool> ? allowInvertVertical, ValueGetter<bool> ? dismissBackdropFocus, ValueGetter<Duration?> ? showDuration, ValueGetter<Duration?> ? dismissDuration, ValueGetter<OverlayBarrier?> ? overlayBarrier, ValueGetter<OverlayHandler?> ? handler}) → PopoverConfiguration<T> - Returns a copy of this configuration with the given fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
show(
BuildContext context) → OverlayCompleter< T?> -
Actually presents the overlay using this configuration's mechanism.
override
-
toDrawer(
{OverlayPosition position = OverlayPosition.bottom}) → DrawerConfiguration< T> - Converts this configuration into an equivalent DrawerConfiguration.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited