FPopover constructor

FPopover({
  1. required Widget popoverBuilder(
    1. BuildContext context,
    2. FPopoverController controller
    ),
  2. FPopoverController? controller,
  3. FPopoverStyle style(
    1. FPopoverStyle style
    )?,
  4. FPortalConstraints constraints = const FPortalConstraints(),
  5. FPortalSpacing spacing = const FPortalSpacing(4),
  6. Offset shift(
    1. Size size,
    2. FPortalChildBox childBox,
    3. FPortalBox portalBox
    ) = FPortalShift.flip,
  7. Offset offset = Offset.zero,
  8. Object? groupId,
  9. FPopoverHideRegion hideRegion = FPopoverHideRegion.excludeChild,
  10. VoidCallback? onTapHide,
  11. bool? autofocus,
  12. FocusScopeNode? focusNode,
  13. ValueChanged<bool>? onFocusChange,
  14. TraversalEdgeBehavior? traversalEdgeBehavior,
  15. String? barrierSemanticsLabel,
  16. bool barrierSemanticsDismissible = true,
  17. String? semanticsLabel,
  18. Map<ShortcutActivator, VoidCallback>? shortcuts,
  19. ValueWidgetBuilder<FPopoverController> builder = _builder,
  20. Widget? child,
  21. AlignmentGeometry? popoverAnchor,
  22. AlignmentGeometry? childAnchor,
  23. Key? key,
})

Creates a popover that only shows the popover when the controller is manually toggled.

Contract

Throws an AssertionError if:

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;