RawTooltip class
A widget that wraps a child to display an informative overlay in response to user interactions, such as hovering or long-pressing.
Tooltips provide essential context by displaying text labels or brief descriptions that explain the function of a button or other user interface elements.
The tooltip can be triggered in several ways:
- By hovering a mouse pointer over the widget.
- By touch interactions, such as a long press or a tap, depending on the configuration of triggerMode.
- Manually, by calling RawTooltipState.ensureTooltipVisible.
See also:
- Tooltip, a Material-themed RawTooltip.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- RawTooltip
Constructors
- RawTooltip({Key? key, required String? semanticsTooltip, required TooltipComponentBuilder tooltipBuilder, Duration hoverDelay = Duration.zero, Duration touchDelay = const Duration(milliseconds: 1500), Duration dismissDelay = const Duration(milliseconds: 100), bool enableTapToDismiss = true, TooltipTriggerMode triggerMode = TooltipTriggerMode.longPress, bool enableFeedback = true, TooltipTriggeredCallback? onTriggered, AnimationStyle animationStyle = _kDefaultAnimationStyle, TooltipPositionDelegate? positionDelegate, required Widget child})
-
Creates a raw tooltip.
const
Properties
- animationStyle → AnimationStyle
-
Used to override the curve and duration of the animation that shows and
hides the tooltip.
final
- child → Widget
-
The widget below this widget in the tree.
final
- dismissDelay → Duration
-
The length of time that a pointer must have stopped hovering over a
tooltip's widget before the tooltip will be hidden.
final
- enableFeedback → bool
-
Whether the tooltip should provide acoustic and/or haptic feedback.
final
- enableTapToDismiss → bool
-
Whether the tooltip can be dismissed by tap.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hoverDelay → Duration
-
The length of time that a pointer must hover over a tooltip's widget
before the tooltip will be shown.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onTriggered → TooltipTriggeredCallback?
-
Called when the RawTooltip is triggered programmatically, on tap, or on
long press.
final
- positionDelegate → TooltipPositionDelegate?
-
A custom position delegate function for computing where the tooltip should
be positioned.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticsTooltip → String?
-
The text to display in the tooltip's semantics announcement.
final
- tooltipBuilder → TooltipComponentBuilder
-
Builds the widget that will be displayed in the tooltip's overlay.
final
- touchDelay → Duration
-
The length of time that the tooltip will be shown after a long press is
released (if triggerMode is TooltipTriggerMode.longPress) or a tap is
released (if triggerMode is TooltipTriggerMode.tap).
final
- triggerMode → TooltipTriggerMode
-
The TooltipTriggerMode that will show the tooltip.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< RawTooltip> -
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.
override
-
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
Static Methods
-
dismissAllToolTips(
) → bool - Dismiss all of the tooltips that are currently shown on the screen, including those with mouse cursors currently hovering over them.