Tooltip class

A material design tooltip.

Tooltips provide text labels that help explain the function of a button or other user interface action. Wrap the button in a Tooltip widget to show a label when the widget long pressed (or when the user takes some other appropriate action).

Many widgets, such as IconButton, FloatingActionButton, and PopupMenuButton have a tooltip property that, when non-null, causes the widget to include a Tooltip in its build.

Tooltips improve the accessibility of visual widgets by proving a textual representation of the widget, which, for example, can be vocalized by a screen reader.

See also:

Inheritance

Constructors

Tooltip({Key key, @required String message, double height: _defaultTooltipHeight, EdgeInsetsGeometry padding: _defaultPadding, double verticalOffset: _defaultVerticalOffset, bool preferBelow: true, bool excludeFromSemantics: false, Decoration decoration, Duration waitDuration: _defaultWaitDuration, Duration showDuration: _defaultShowDuration, Widget child })
Creates a tooltip. [...]
const

Properties

child Widget
The widget below this widget in the tree. [...]
final
decoration Decoration
Specifies the tooltip's shape and background color. [...]
final
excludeFromSemantics bool
Whether the tooltip's message should be excluded from the semantics tree.
final
height double
They height of the tooltip's child. [...]
final
message String
The text to display in the tooltip.
final
padding EdgeInsetsGeometry
The amount of space by which to inset the child. [...]
final
preferBelow bool
Whether the tooltip defaults to being displayed below the widget. [...]
final
showDuration Duration
The amount of time that the tooltip will be shown once it has appeared. [...]
final
verticalOffset double
The vertical gap between the widget and the displayed tooltip.
final
waitDuration Duration
The amount of time that a pointer must hover over the widget before it will show a tooltip. [...]
final
hashCode int
The hash code for this object. [...]
read-only, inherited
key Key
Controls how one widget replaces another widget in the tree. [...]
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

createState() → _TooltipState
Creates the mutable state for this widget at a given location in the tree. [...]
override
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
override
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree. [...]
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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.debug }) String
Returns a string representation of this object.
inherited
toStringDeep({String prefixLineOne: '', String prefixOtherLines, DiagnosticLevel minLevel: DiagnosticLevel.debug }) 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 ==(dynamic other) bool
The equality operator. [...]
inherited