FPopover constructor
FPopover({
- required Widget popoverBuilder(
- BuildContext context,
- FPopoverController controller
- FPopoverController? controller,
- FPopoverStyle style(
- FPopoverStyle style
- FPortalConstraints constraints = const FPortalConstraints(),
- FPortalSpacing spacing = const FPortalSpacing(4),
- Offset shift(
- Size size,
- FPortalChildBox childBox,
- FPortalBox portalBox
- Offset offset = Offset.zero,
- Object? groupId,
- FPopoverHideRegion hideRegion = FPopoverHideRegion.excludeChild,
- VoidCallback? onTapHide,
- bool? autofocus,
- FocusScopeNode? focusNode,
- ValueChanged<
bool> ? onFocusChange, - TraversalEdgeBehavior? traversalEdgeBehavior,
- String? barrierSemanticsLabel,
- bool barrierSemanticsDismissible = true,
- String? semanticsLabel,
- Map<
ShortcutActivator, VoidCallback> ? shortcuts, - ValueWidgetBuilder<
FPopoverController> builder = _builder, - 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:
groupId
is not null andhideRegion
is not set to FPopoverHideRegion.excludeChild.- neither
builder
norchild
is provided.
Implementation
FPopover({
required this.popoverBuilder,
this.controller,
this.style,
this.constraints = const FPortalConstraints(),
this.spacing = const FPortalSpacing(4),
this.shift = FPortalShift.flip,
this.offset = Offset.zero,
this.groupId,
this.hideRegion = FPopoverHideRegion.excludeChild,
this.onTapHide,
this.autofocus,
this.focusNode,
this.onFocusChange,
this.traversalEdgeBehavior,
this.barrierSemanticsLabel,
this.barrierSemanticsDismissible = true,
this.semanticsLabel,
this.shortcuts,
this.builder = _builder,
this.child,
AlignmentGeometry? popoverAnchor,
AlignmentGeometry? 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 != _builder || child != null, 'Either builder or child must be provided'),
popoverAnchor = popoverAnchor ?? defaultPlatform.popover,
childAnchor = childAnchor ?? defaultPlatform.child;