Tooltip class
A component that displays contextual tooltip text or content when hovering or focusing over the child component.
Example
Tooltip(
text: 'Settings',
position: TooltipPosition.bottom,
child: Button(child: NakiText('Open')),
)
- Mixed-in types
Constructors
- Tooltip({Key? key, required Component child, TooltipPosition position = TooltipPosition.top, String? text, Component? content, Color? backgroundColor, Gradient? gradient, Color? foregroundColor, BorderRadiusData? borderRadius, EdgeInsets? padding, SizeConstraints? sizeConstraints, String? classes, String? id})
-
A component that displays contextual tooltip text or content when
hovering or focusing over the child component.
const
Properties
- backgroundColor → Color?
-
Tooltip background color.
final
- borderRadius → BorderRadiusData?
-
Tooltip border radius.
final
- child → Component
-
Target component wrapped by the tooltip.
final
- classes → String?
-
Optional CSS classes applied to the tooltip content.
final
- content → Component?
-
Custom content that overrides text.
final
- foregroundColor → Color?
-
Color applied to the tooltip content.
final
- gradient → Gradient?
-
Tooltip background gradient.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String?
-
Unique identifier used to connect the target and tooltip content.
final
- key → Key?
-
Controls how one component replaces another component in the tree.
finalinherited
- padding → EdgeInsets?
-
Tooltip content padding.
final
- position → TooltipPosition
-
Tooltip placement (top, bottom, left, right).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sizeConstraints → SizeConstraints?
-
Size constraints of the tooltip content.
final
- text → String?
-
Text displayed in the tooltip when content is not defined.
final
Methods
-
afterRender(
BuildContext context) → FutureOr< VoidCallback?> -
This method is called only once after the component is built and
the browser has rendered it. Does nothing on server rendering.
override
-
build(
BuildContext context) → Component - Describes the part of the user interface represented by this component.
-
createElement(
) → Element -
Creates a
StatelessElementto manage this component's location in the tree.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shouldRebuild(
covariant Component newComponent) → bool -
Implement this method to determine whether a rebuild can be skipped.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited