FluentTooltip class
A Fluent 2 tooltip.
FluentTooltip(
content: const Text('Save the document'),
child: FluentButton.icon(
icon: const Icon(FluentIcons.save_20_regular),
semanticLabel: 'Save',
onPressed: () {},
),
)
Appears on pointer hover and on keyboard-visible focus. Hover is delayed
250ms each way, matching useTooltipBase's showDelay/hideDelay; focus
and blur are immediate, because a tooltip trailing a quarter second behind
the focus ring reads as a fault. enabled is a real state rather than a
visual treatment: a disabled tooltip is never inserted into the Overlay at
all, and one that is already showing when it is disabled is torn down at
once, without waiting out the delay.
No motion
Upstream ships no transition for the tooltip on master, and its old slide
path is explicitly deprecated, so this appears and disappears on the frame
the trigger changes. That is not an omission waiting to be polished with a
fade — see the note on FluentMotionSpec. It also makes the component
trivially correct under reduced motion: there is no animation to shorten.
Positioning
The surface is placed by an OverlayEntry anchored with
CompositedTransformFollower, so it escapes any ancestor clip or overflow
and follows the trigger as it moves. FluentTheme is an InheritedTheme,
and the themes between this widget and the overlay are captured on the way
in, so tokens resolve against the trigger's theme rather than the app root's.
Customisation follows the same three rungs as the rest of the package. style is merged last and wins; FluentTooltipTheme restyles a subtree; and resolveFluentTooltipState, resolveFluentTooltipStyle and buildFluentTooltip are public so any one of them can be replaced without forking this widget.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- FluentTooltip
Constructors
- FluentTooltip({Key? key, required Widget child, required Widget content, FluentTooltipAppearance appearance = FluentTooltipAppearance.normal, FluentTooltipPosition position = FluentTooltipPosition.above, bool withArrow = false, bool enabled = true, FluentTooltipStyle? style, String? semanticLabel})
-
Wraps
childwith a tooltip showingcontent.const
Properties
- appearance → FluentTooltipAppearance
-
Fill treatment.
final
- child → Widget
-
The trigger. Hovering or keyboard-focusing it shows the tooltip.
final
- content → Widget
-
The tooltip body. Wraps at 240 logical pixels.
final
- enabled → bool
-
Whether the tooltip may appear at all.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- position → FluentTooltipPosition
-
Which side of child the surface sits on.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String?
-
Announced by assistive technology alongside the trigger.
final
- style → FluentTooltipStyle?
-
Overrides layered over the theme defaults. Merged last, so it wins.
final
- withArrow → bool
-
Whether to draw the pointing arrow.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< FluentTooltip> -
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