UIPopover class

Rich anchored popover with arrow, optional scrim, and custom content.

Uses UIPortal for positioning and an optional full-screen scrim for coach-mark / onboarding flows. Control visibility with UIAnchoredOverlayController.

final _coach = UIAnchoredOverlayController();

UIPopover(
  controller: _coach,
  showScrim: true,
  showCloseButton: true,
  content: const Text('Tap here to start'),
  child: IconButton(
    icon: const Icon(Icons.help_outline),
    onPressed: _coach.show,
  ),
);
Inheritance

Constructors

UIPopover({Key? key, required Widget child, required Widget content, UIAnchoredOverlayController? controller, UIPopoverDirection direction = UIPopoverDirection.below, bool showScrim = false, Color? scrimColor, bool dismissOnTapOutside = true, bool showCloseButton = false, String? closeButtonTooltip, Color? backgroundColor, double borderRadius = 12, EdgeInsetsGeometry padding = const EdgeInsets.all(12), double arrowLength = 8, double arrowBaseWidth = 16, double gap = 4, double maxWidth = 280, bool rootOverlay = true})
const
UIPopover.fromTheme(BuildContext context, {Key? key, required Widget child, required Widget content, UIAnchoredOverlayController? controller, UIPopoverDirection direction = UIPopoverDirection.below, bool showScrim = false, Color? scrimColor, bool dismissOnTapOutside = true, bool showCloseButton = false, String? closeButtonTooltip, Color? backgroundColor, double borderRadius = 12, EdgeInsetsGeometry padding = const EdgeInsets.all(12), double arrowLength = 8, double arrowBaseWidth = 16, double gap = 4, double maxWidth = 280, bool rootOverlay = true})
Theme-aware defaults for background and scrim colors.
factory

Properties

arrowBaseWidth double
final
arrowLength double
final
backgroundColor Color?
final
borderRadius double
final
child Widget
final
closeButtonTooltip String?
Tooltip / semantic label for the close button.
final
content Widget
final
controller UIAnchoredOverlayController?
final
direction UIPopoverDirection
final
dismissOnTapOutside bool
final
gap double
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxWidth double
final
padding EdgeInsetsGeometry
final
rootOverlay bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrimColor Color?
final
showCloseButton bool
final
showScrim bool
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<UIPopover>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited