TPopover class

A floating, anchored popup card attached to a target child trigger.

Supports customizable alignment relative to trigger, title bar with close button, outside-tap dismissal, keyboard (Esc) handling, and custom content builders.

Inheritance
Available extensions

Constructors

TPopover({Key? key, required Widget child, Widget? content, Widget builder(BuildContext context, VoidCallback close)?, String? title, Widget? titleWidget, bool showCloseButton = false, TPopupAlignment alignment = TPopupAlignment.bottomLeft, TMenuTriggerMode triggerMode = TMenuTriggerMode.tap, double offset = 8.0, bool barrierDismissible = true, double? width, double minWidth = 160.0, double maxWidth = 360.0, double? minHeight, double? maxHeight, EdgeInsetsGeometry padding = const EdgeInsets.all(14.0), BorderRadiusGeometry? borderRadius, Color? backgroundColor, Color? borderColor, double elevation = 8.0, TPopoverController? controller, VoidCallback? onOpen, VoidCallback? onClose})
const

Properties

alignment → TPopupAlignment
Alignment of the popover relative to its target trigger.
final
backgroundColor → Color?
Background color override.
final
barrierDismissible → bool
Whether tapping outside dismisses the popover.
final
borderColor → Color?
Border color override.
final
borderRadius → BorderRadiusGeometry?
Border radius of the popover card.
final
builder → Widget Function(BuildContext context, VoidCallback close)?
Dynamic builder providing the close callback.
final
child → Widget
The target trigger widget.
final
content → Widget?
Static widget content inside the popover card.
final
controller → TPopoverController?
Optional controller to programmatically manage the popover.
final
elevation → double
Elevation shadow depth.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxHeight → double?
Optional maximum height constraint.
final
maxWidth → double
Maximum width constraint.
final
minHeight → double?
Optional minimum height constraint.
final
minWidth → double
Minimum width constraint.
final
offset → double
Gap distance in pixels between the trigger and the popover.
final
onClose → VoidCallback?
Callback fired when popover closes.
final
onOpen → VoidCallback?
Callback fired when popover opens.
final
padding → EdgeInsetsGeometry
Inner padding of the popover card.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showCloseButton → bool
Whether to display a close button in the header.
final
title → String?
Optional header title text.
final
titleWidget → Widget?
Optional custom title widget.
final
triggerMode → TMenuTriggerMode
Trigger gesture mode (tap or hover).
final
width → double?
Optional fixed width for the popover card.
final

Methods

box({double minW = 0.0, double minH = 0.0, double maxW = double.infinity, double maxH = double.infinity}) → Widget

Available on Widget, provided by the WidgetX extension

Wraps this widget in a ConstrainedBox to apply layout constraints.
center({bool when = true}) → Widget

Available on Widget, provided by the WidgetX extension

Wraps this widget in a Center widget.
createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<TPopover>
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
expanded({int flex = 1}) → Widget

Available on Widget, provided by the WidgetX extension

Wraps this widget in an Expanded widget.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
padding([double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0]) → Widget

Available on Widget, provided by the WidgetX extension

Wraps this widget in a Padding with flexible edge control.
paddingSymmetric({double h = 0.0, double v = 0.0}) → Widget

Available on Widget, provided by the WidgetX extension

Wraps this widget in a Padding with symmetric horizontal and vertical spacing.
size({double? w, double? h}) → Widget

Available on Widget, provided by the WidgetX extension

Wraps this widget in a SizedBox to apply fixed width and/or height.
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
visible(bool visible, {bool maintainState = false}) → Widget

Available on Widget, provided by the WidgetX extension

Wraps this widget in a Visibility widget.
when(bool condition) → Widget

Available on Widget, provided by the WidgetX extension

Returns this widget if condition is true, otherwise returns SizedBox.shrink(). Usage: Text('Hello').when(isVisible)

Operators

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