FPopover.automatic constructor
FPopover.automatic({
- required ValueWidgetBuilder<
FPopoverStyle> popoverBuilder, - required Widget child,
- FPopoverController? controller,
- FPopoverStyle? style,
- FPortalConstraints constraints = const FPortalConstraints(),
- FPortalSpacing spacing = const FPortalSpacing(4),
- Offset shift() = FPortalShift.flip,
- Offset offset = Offset.zero,
- Object? groupId,
- FHidePopoverRegion hideOnTapOutside = FHidePopoverRegion.excludeTarget,
- bool autofocus = false,
- FocusScopeNode? focusNode,
- ValueChanged<
bool> ? onFocusChange, - TraversalEdgeBehavior traversalEdgeBehavior = TraversalEdgeBehavior.closedLoop,
- String? semanticsLabel,
- Map<
ShortcutActivator, VoidCallback> ? shortcuts, - AlignmentGeometry? popoverAnchor,
- AlignmentGeometry? childAnchor,
- Key? key,
Creates a popover that is automatically shown when the child
is tapped.
It is not recommended for the child
to contain a GestureDetector, such as FButton. Only one
GestureDetector
will be called if there are multiple overlapping GestureDetector
s, leading to unexpected
behavior.
Implementation
FPopover.automatic({
required this.popoverBuilder,
required this.child,
this.controller,
this.style,
this.constraints = const FPortalConstraints(),
this.spacing = const FPortalSpacing(4),
this.shift = FPortalShift.flip,
this.offset = Offset.zero,
this.groupId,
this.hideOnTapOutside = FHidePopoverRegion.excludeTarget,
this.autofocus = false,
this.focusNode,
this.onFocusChange,
this.traversalEdgeBehavior = TraversalEdgeBehavior.closedLoop,
this.semanticsLabel,
this.shortcuts,
AlignmentGeometry? popoverAnchor,
AlignmentGeometry? childAnchor,
super.key,
}) : assert(
groupId == null || hideOnTapOutside == FHidePopoverRegion.excludeTarget,
'groupId can only be used with FHidePopoverRegion.excludeTarget',
),
popoverAnchor = popoverAnchor ?? defaultPlatform.popover,
childAnchor = childAnchor ?? defaultPlatform.child,
_automatic = true;