MyTooltip constructor

const MyTooltip({
  1. Key? key,
  2. required Widget child,
  3. required Widget tooltipContent,
  4. TooltipPositionExtended tooltipPosition = TooltipPositionExtended.bottomCenter,
  5. double tooltipDistance = 8.0,
  6. Offset additionalOffset = Offset.zero,
  7. double tooltipWidth = 200.0,
  8. double tooltipHeight = 100.0,
  9. 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))]),
  10. EdgeInsets tooltipPadding = const EdgeInsets.all(8.0),
  11. Duration longPressDelay = const Duration(seconds: 1),
  12. Duration animationDuration = const Duration(milliseconds: 300),
  13. Duration autoHideDelay = const Duration(seconds: 3),
  14. bool showOnHover = true,
  15. 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,
});