PopoverLayer class
A widget that shows an anchored content popover around its child.
Wrap the trigger and describe the floating content; the popover positions itself around the trigger, flipping and shifting to stay on screen. Components with richer behaviour (Popconfirm, Dropdown) build directly on PopoverController instead. A floating surface anchored to a trigger — the layer the kit's components stand on rather than a component itself.
It positions and nothing more: Popover, Tooltip, Dropdown, Select, Popconfirm and Tour each give it a surface of their own and decide what opens it. A caller who wants a card with a title and a body wants Popover; this is for building something the kit has not got.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PopoverLayer
Constructors
-
PopoverLayer({Key? key, required Widget child, required WidgetBuilder content, PopoverPlacement placement = PopoverPlacement.top, bool? open, ValueChanged<
bool> ? onOpenChanged, double gap = 8, bool dismissOnOutsideTap = true, bool interactive = true, Color? arrowColor, List<BoxShadow> ? arrowShadow, Color? barrierColor, PopoverAnimation animation = PopoverAnimation.simple, Duration? duration, Curve? curve}) -
Creates a PopoverLayer.
const
Properties
- animation → PopoverAnimation
-
How the surface arrives — a fade and a grow, or the genie.
final
- arrowColor → Color?
-
When non-null, draws a caret of this colour pointing at the trigger. Use
the popover content's own background colour so the two read as one shape.
final
-
arrowShadow
→ List<
BoxShadow> ? -
Shadow drawn under the caret. Pass the content's own shadow so the caret
and bubble read as a single surface.
final
- barrierColor → Color?
-
Tint painted over the page behind an open popover. Null leaves it clear.
final
- child → Widget
-
The trigger the popover anchors to.
final
- content → WidgetBuilder
-
Builds the floating content.
final
- curve → Curve?
-
The curve the arrival runs on. Null takes the pace the animation wants.
final
- dismissOnOutsideTap → bool
-
Whether tapping outside dismisses the popover.
final
- duration → Duration?
-
How long it takes to arrive, and on what curve. Null takes the pace the
animation wants.
final
- gap → double
-
Distance between the trigger and the popover, in logical pixels.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- interactive → bool
-
When false the content ignores pointer events. Set it for tooltips, so
the floating text cannot steal hover from the widgets beneath it.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onOpenChanged
→ ValueChanged<
bool> ? -
Notified when the popover wants to open or close (outside tap, etc.).
final
- open → bool?
-
Drives visibility externally. Null lets the popover manage its own state
via onOpenChanged.
final
- placement → PopoverPlacement
-
Which side of the trigger the popover prefers.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< PopoverLayer> -
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