FPortal constructor

const FPortal({
  1. required Widget portalBuilder(
    1. BuildContext context,
    2. OverlayPortalController controller
    ),
  2. OverlayPortalController? controller,
  3. FPortalConstraints constraints = const FPortalConstraints(),
  4. AlignmentGeometry portalAnchor = .topCenter,
  5. AlignmentGeometry childAnchor = .bottomCenter,
  6. FPortalSpacing spacing = .zero,
  7. FPortalOverflow overflow = .flip,
  8. Offset offset = .zero,
  9. bool useViewPadding = true,
  10. bool useViewInsets = true,
  11. EdgeInsetsGeometry padding = .zero,
  12. Widget barrier(
    1. RenderBox? cutout
    )?,
  13. ValueWidgetBuilder<OverlayPortalController> builder = defaultBuilder,
  14. Widget? child,
  15. Key? key,
})

Creates a portal.

Contract

Throws AssertionError if builder and child are both null.

Implementation

const FPortal({
  required this.portalBuilder,
  this.controller,
  this.constraints = const FPortalConstraints(),
  this.portalAnchor = .topCenter,
  this.childAnchor = .bottomCenter,
  this.spacing = .zero,
  this.overflow = .flip,
  this.offset = .zero,
  this.useViewPadding = true,
  this.useViewInsets = true,
  this.padding = .zero,
  this.barrier,
  this.builder = defaultBuilder,
  this.child,
  super.key,
}) : assert(builder != defaultBuilder || child != null, 'Either builder or child must be provided');