show<T> method

  1. @override
OverlayCompleter<T?> show<T>({
  1. required BuildContext context,
  2. required AlignmentGeometry alignment,
  3. required WidgetBuilder builder,
  4. Offset? position,
  5. AlignmentGeometry? anchorAlignment,
  6. PopoverConstraint widthConstraint = PopoverConstraint.flexible,
  7. PopoverConstraint heightConstraint = PopoverConstraint.flexible,
  8. Key? key,
  9. bool rootOverlay = true,
  10. bool modal = true,
  11. bool barrierDismissable = true,
  12. Clip clipBehavior = Clip.none,
  13. Object? regionGroupId,
  14. Offset? offset,
  15. AlignmentGeometry? transitionAlignment,
  16. EdgeInsetsGeometry? margin,
  17. bool follow = true,
  18. bool consumeOutsideTaps = true,
  19. Anchor? anchor,
  20. ValueChanged<PopoverOverlayWidgetState>? onTickFollow,
  21. bool allowInvertHorizontal = true,
  22. bool allowInvertVertical = true,
  23. bool dismissBackdropFocus = true,
  24. Duration? showDuration,
  25. Duration? dismissDuration,
  26. OverlayBarrier? overlayBarrier,
})
override

Shows an overlay with the specified configuration.

Displays an overlay (popover, sheet, or dialog) with extensive customization options for positioning, sizing, behavior, and appearance.

Parameters:

  • context (BuildContext, required): Build context
  • alignment (AlignmentGeometry, required): Overlay alignment
  • builder (WidgetBuilder, required): Overlay content builder
  • position (Offset?): Explicit position (overrides alignment)
  • anchorAlignment (AlignmentGeometry?): Anchor alignment
  • widthConstraint (PopoverConstraint): Width constraint, defaults to flexible
  • heightConstraint (PopoverConstraint): Height constraint, defaults to flexible
  • key (Key?): Widget key
  • rootOverlay (bool): Use root overlay, defaults to true
  • modal (bool): Modal behavior, defaults to true
  • barrierDismissable (bool): Dismissible by tapping barrier, defaults to true
  • clipBehavior (Clip): Clipping behavior, defaults to none
  • regionGroupId (Object?): Region group ID
  • offset (Offset?): Position offset
  • transitionAlignment (AlignmentGeometry?): Transition alignment
  • margin (EdgeInsetsGeometry?): Overlay margin
  • follow (bool): Follow anchor on move, defaults to true
  • consumeOutsideTaps (bool): Consume outside taps, defaults to true
  • onTickFollow (ValueChanged<PopoverOverlayWidgetState>?): Follow tick callback
  • allowInvertHorizontal (bool): Allow horizontal inversion, defaults to true
  • allowInvertVertical (bool): Allow vertical inversion, defaults to true
  • dismissBackdropFocus (bool): Dismiss on backdrop focus, defaults to true
  • showDuration (Duration?): Show animation duration
  • dismissDuration (Duration?): Dismiss animation duration
  • overlayBarrier (OverlayBarrier?): Custom barrier configuration
  • anchor (Anchor?): Anchor to position/track against, defaults to a ContextAnchor wrapping context

Returns an OverlayCompleter for managing the overlay lifecycle.

Implementation

@override
OverlayCompleter<T?> show<T>({
  required BuildContext context,
  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,
  Anchor? anchor,
  ValueChanged<PopoverOverlayWidgetState>? onTickFollow,
  bool allowInvertHorizontal = true,
  bool allowInvertVertical = true,
  bool dismissBackdropFocus = true,
  Duration? showDuration,
  Duration? dismissDuration,
  OverlayBarrier? overlayBarrier,
}) {
  return manager.showMenu(
    context: context,
    alignment: alignment,
    builder: builder,
    position: position,
    anchorAlignment: anchorAlignment,
    widthConstraint: widthConstraint,
    heightConstraint: heightConstraint,
    key: key,
    rootOverlay: rootOverlay,
    modal: modal,
    barrierDismissable: barrierDismissable,
    clipBehavior: clipBehavior,
    regionGroupId: regionGroupId,
    offset: offset,
    transitionAlignment: transitionAlignment,
    margin: margin,
    follow: follow,
    consumeOutsideTaps: consumeOutsideTaps,
    anchor: anchor,
    onTickFollow: onTickFollow,
    allowInvertHorizontal: allowInvertHorizontal,
    allowInvertVertical: allowInvertVertical,
    dismissBackdropFocus: dismissBackdropFocus,
    showDuration: showDuration,
    dismissDuration: dismissDuration,
    overlayBarrier: overlayBarrier,
  );
}