MyTooltip constructor
const
MyTooltip({
- Key? key,
- required Widget child,
- required Widget tooltipContent,
- TooltipPositionExtended tooltipPosition = TooltipPositionExtended.bottomCenter,
- double tooltipDistance = 8.0,
- Offset additionalOffset = Offset.zero,
- double tooltipWidth = 200.0,
- double tooltipHeight = 100.0,
- BoxDecoration tooltipDecoration = const BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(8.0)), boxShadow: [BoxShadow(color: Colors.black26, blurRadius: 8, offset: Offset(0, 4))]),
- EdgeInsets tooltipPadding = const EdgeInsets.all(8.0),
- Duration longPressDelay = const Duration(seconds: 1),
- Duration animationDuration = const Duration(milliseconds: 300),
- Duration autoHideDelay = const Duration(seconds: 3),
- bool showOnHover = true,
- bool showOnLongPress = true,
Implementation
const MyTooltip({
super.key,
required this.child,
required this.tooltipContent,
this.tooltipPosition = TooltipPositionExtended.bottomCenter,
this.tooltipDistance = 8.0,
this.additionalOffset = Offset.zero,
this.tooltipWidth = 200.0,
this.tooltipHeight = 100.0,
this.tooltipDecoration = const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(8.0)),
boxShadow: [
BoxShadow(color: Colors.black26, blurRadius: 8, offset: Offset(0, 4)),
],
),
this.tooltipPadding = const EdgeInsets.all(8.0),
this.longPressDelay = const Duration(seconds: 1),
this.animationDuration = const Duration(milliseconds: 300),
// Set autoHideDelay to 3 seconds by default; set to Duration.zero to disable auto-hide.
this.autoHideDelay = const Duration(seconds: 3),
this.showOnHover = true,
this.showOnLongPress = true,
});