show<T> method
Future<T?>
show<T>({
- required BuildContext context,
- required WidgetBuilder builder,
- required AlignmentGeometry alignment,
- AlignmentGeometry? anchorAlignment,
- PopoverConstraint widthConstraint = PopoverConstraint.flexible,
- PopoverConstraint heightConstraint = PopoverConstraint.flexible,
- bool modal = true,
- bool closeOthers = true,
- Offset? offset,
- GlobalKey<
OverlayHandlerStateMixin< ? key,StatefulWidget> > - Object? regionGroupId,
- AlignmentGeometry? transitionAlignment,
- bool consumeOutsideTaps = true,
- EdgeInsetsGeometry? margin,
- ValueChanged<
PopoverAnchorState> ? onTickFollow, - bool follow = true,
- bool allowInvertHorizontal = true,
- bool allowInvertVertical = true,
- bool dismissBackdropFocus = true,
- Duration? showDuration,
- Duration? hideDuration,
- OverlayBarrier? overlayBarrier,
- OverlayHandler? handler,
Implementation
Future<T?> show<T>({
required BuildContext context,
required WidgetBuilder builder,
required AlignmentGeometry alignment,
AlignmentGeometry? anchorAlignment,
PopoverConstraint widthConstraint = PopoverConstraint.flexible,
PopoverConstraint heightConstraint = PopoverConstraint.flexible,
bool modal = true,
bool closeOthers = true,
Offset? offset,
GlobalKey<OverlayHandlerStateMixin>? key,
Object? regionGroupId,
AlignmentGeometry? transitionAlignment,
bool consumeOutsideTaps = true,
EdgeInsetsGeometry? margin,
ValueChanged<PopoverAnchorState>? onTickFollow,
bool follow = true,
bool allowInvertHorizontal = true,
bool allowInvertVertical = true,
bool dismissBackdropFocus = true,
Duration? showDuration,
Duration? hideDuration,
OverlayBarrier? overlayBarrier,
OverlayHandler? handler,
}) async {
if (closeOthers) {
close();
}
builder = Pylon.mirror(context, builder);
key ??= GlobalKey<OverlayHandlerStateMixin>(
debugLabel: 'PopoverAnchor$hashCode');
OverlayCompleter<T?> res = showPopover<T>(
context: context,
alignment: alignment,
anchorAlignment: anchorAlignment,
builder: builder,
modal: modal,
widthConstraint: widthConstraint,
heightConstraint: heightConstraint,
key: key,
regionGroupId: regionGroupId,
offset: offset,
transitionAlignment: transitionAlignment,
consumeOutsideTaps: consumeOutsideTaps,
margin: margin,
onTickFollow: onTickFollow,
follow: follow,
allowInvertHorizontal: allowInvertHorizontal,
allowInvertVertical: allowInvertVertical,
dismissBackdropFocus: dismissBackdropFocus,
showDuration: showDuration,
dismissDuration: hideDuration,
overlayBarrier: overlayBarrier,
handler: handler,
);
var popover = Popover._(
key,
res,
);
_openPopovers.add(popover);
notifyListeners();
await res.future;
_openPopovers.remove(popover);
if (!_disposed) {
notifyListeners();
}
return res.future;
}