show<T> method
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,
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 contextalignment(AlignmentGeometry, required): Overlay alignmentbuilder(WidgetBuilder, required): Overlay content builderposition(Offset?): Explicit position (overrides alignment)anchorAlignment(AlignmentGeometry?): Anchor alignmentwidthConstraint(PopoverConstraint): Width constraint, defaults to flexibleheightConstraint(PopoverConstraint): Height constraint, defaults to flexiblekey(Key?): Widget keyrootOverlay(bool): Use root overlay, defaults to truemodal(bool): Modal behavior, defaults to truebarrierDismissable(bool): Dismissible by tapping barrier, defaults to trueclipBehavior(Clip): Clipping behavior, defaults to noneregionGroupId(Object?): Region group IDoffset(Offset?): Position offsettransitionAlignment(AlignmentGeometry?): Transition alignmentmargin(EdgeInsetsGeometry?): Overlay marginfollow(bool): Follow anchor on move, defaults to trueconsumeOutsideTaps(bool): Consume outside taps, defaults to trueonTickFollow(ValueChanged<PopoverOverlayWidgetState>?): Follow tick callbackallowInvertHorizontal(bool): Allow horizontal inversion, defaults to trueallowInvertVertical(bool): Allow vertical inversion, defaults to truedismissBackdropFocus(bool): Dismiss on backdrop focus, defaults to trueshowDuration(Duration?): Show animation durationdismissDuration(Duration?): Dismiss animation durationoverlayBarrier(OverlayBarrier?): Custom barrier configurationanchor(Anchor?): Anchor to position/track against, defaults to a ContextAnchor wrappingcontext
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,
);
}