FossTooltip class

See the tooltip documentation ↗ or try it live in the playground ↗.
Wraps a child trigger and shows a small floating hint next to it on hover,
keyboard focus, or long-press, dismissing on exit, blur, Escape, or after
hideDelay.
The hint is text only (message) and non-interactive: it never blocks pointer input and is announced through the trigger's tooltip semantics, so the visible popup stays out of the semantics tree. The popup opens on side and flips to the opposite side to stay on screen. Colors, type, radius, and shadow resolve from the theme; pass a style for a one-off override.
Customize globally by passing your own FossThemeData, or per instance
through the widget's style object. There are no per-instance token props:
to change color, radius, or spacing, change the theme.
FossTooltip(
message: 'Copy link',
child: FossButton(
onPressed: copy,
child: const Text('Copy'),
),
);
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- FossTooltip
Constructors
- FossTooltip({required String message, required Widget child, FossTooltipSide side = FossTooltipSide.top, Duration showDelay = const Duration(milliseconds: 500), Duration hideDelay = Duration.zero, String? semanticLabel, FossTooltipStyle? style, Key? key})
-
const
Properties
- child → Widget
-
The trigger. Rendered as-is; the tooltip adds no visual to it.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hideDelay → Duration
-
Delay before the popup dismisses after the trigger ends.
Escapedismisses immediately and bypasses this delay.final - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- message → String
-
The hint text shown in the popup.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String?
-
Overrides the announced text when it should differ from message.
final
- showDelay → Duration
-
Delay before the popup appears after the trigger activates.
Escapedismisses immediately and bypasses this delay.final - side → FossTooltipSide
-
The preferred side to open on. Defaults to FossTooltipSide.top.
final
- style → FossTooltipStyle?
-
Per-instance visual overrides.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< FossTooltip> -
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