A highly customizable tooltip widget for Flutter applications that provides rich functionality for displaying tooltips with various trigger modes, dismiss behaviors, and styling options.
-
🎯 Multiple Trigger Modes
- Tap
- Long Press
- Double Tap
- Manual Control
-
🎨 Customizable Appearance
- Custom Colors
- Adjustable Size
- Flexible Styling
- Custom Decorations
-
📍 Smart Positioning
- Automatic Edge Detection
- Multiple Directions (Top, Bottom, Left, Right)
- Customizable Padding and Offset
- Axis Control (Vertical/Horizontal)
-
🎮 Flexible Control
- Built-in Controller
- Show/Hide Callbacks
- Custom Dismiss Behaviors
- Event Handling
Add Widget Tooltip to your pubspec.yaml
:
dependencies:
widget_tooltip: ^1.0.0 # Replace with the latest version
Or run:
flutter pub add widget_tooltip
import 'package:widget_tooltip/widget_tooltip.dart';
// Basic usage
WidgetTooltip(
message: Text('Hello World!'),
child: Icon(Icons.info),
)
// Customized tooltip
WidgetTooltip(
message: Text(
'Styled tooltip',
style: TextStyle(color: Colors.white),
),
child: Icon(Icons.help),
triggerMode: WidgetTooltipTriggerMode.tap,
direction: WidgetTooltipDirection.top,
messageDecoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.2),
blurRadius: 4,
offset: Offset(0, 2),
),
],
),
messagePadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 8,
),
)
- ✅ Android
- ✅ iOS
- ✅ Web
- ✅ Windows
- ✅ macOS
- ✅ Linux
- Flutter SDK: >=3.0.0
- Dart SDK: >=3.0.0
Flutter's built-in Tooltip widget is great for simple use cases, but when you need more control over the appearance and behavior of your tooltips, Widget Tooltip provides:
- Rich Customization: Full control over the tooltip's appearance, including custom widgets as content
- Smart Positioning: Automatically adjusts position to stay within screen bounds
- Multiple Triggers: Choose from various trigger modes or implement manual control
- Flexible Dismiss Behavior: Configure how tooltips are dismissed based on your needs
- Controller Support: Programmatically control tooltip visibility
- Callback Support: React to tooltip show/hide events
For detailed documentation and examples, visit our documentation site.
This project is licensed under the MIT License - see the LICENSE file for details.