FPopover constructor
const
FPopover({
- required Widget popoverBuilder(
- BuildContext context,
- FPopoverController controller
- FPopoverControl control = const .managed(),
- FPopoverStyleDelta style = const .context(),
- FPortalConstraints constraints = const FPortalConstraints(),
- FPortalSpacing spacing = const .spacing(4),
- FPortalOverflow overflow = .flip,
- bool useViewPadding = true,
- bool useViewInsets = true,
- Offset offset = .zero,
- Object? groupId,
- FPopoverHideRegion hideRegion = .excludeChild,
- VoidCallback? onTapHide,
- bool? autofocus,
- FocusScopeNode? focusNode,
- ValueChanged<
bool> ? onFocusChange, - TraversalEdgeBehavior? traversalEdgeBehavior,
- String? barrierSemanticsLabel,
- bool barrierSemanticsDismissible = true,
- bool cutout = true,
- void cutoutBuilder() = FModalBarrier.defaultCutoutBuilder,
- String? semanticsLabel,
- Map<
ShortcutActivator, VoidCallback> ? shortcuts, - ValueWidgetBuilder<
FPopoverController> builder = defaultBuilder, - Widget? child,
- AlignmentGeometry? popoverAnchor,
- AlignmentGeometry? childAnchor,
- Key? key,
Creates a popover that only shows the popover when the controller is manually toggled.
Contract
Throws an AssertionError if:
groupIdis not null andhideRegionis not set to FPopoverHideRegion.excludeChild.- neither
buildernorchildis provided.
Implementation
const FPopover({
required this.popoverBuilder,
this.control = const .managed(),
this.style = const .context(),
this.constraints = const FPortalConstraints(),
this.spacing = const .spacing(4),
this.overflow = .flip,
this.useViewPadding = true,
this.useViewInsets = true,
this.offset = .zero,
this.groupId,
this.hideRegion = .excludeChild,
this.onTapHide,
this.autofocus,
this.focusNode,
this.onFocusChange,
this.traversalEdgeBehavior,
this.barrierSemanticsLabel,
this.barrierSemanticsDismissible = true,
this.cutout = true,
this.cutoutBuilder = FModalBarrier.defaultCutoutBuilder,
this.semanticsLabel,
this.shortcuts,
this.builder = defaultBuilder,
this.child,
this.popoverAnchor,
this.childAnchor,
super.key,
}) : assert(
groupId == null || hideRegion == FPopoverHideRegion.excludeChild,
'groupId can only be used with FPopoverHideRegion.excludeChild',
),
assert(
focusNode == null || traversalEdgeBehavior == null,
'Cannot provide both focusNode and traversalEdgeBehavior',
),
assert(builder != defaultBuilder || child != null, 'Either builder or child must be provided');