Tooltip constructor

const Tooltip({
  1. Key? key,
  2. String? message,
  3. InlineSpan? richMessage,
  4. @Deprecated('Use Tooltip.constraints instead. ' 'This feature was deprecated after v3.30.0-0.1.pre.') double? height,
  5. BoxConstraints? constraints,
  6. EdgeInsetsGeometry? padding,
  7. EdgeInsetsGeometry? margin,
  8. double? verticalOffset,
  9. bool? preferBelow,
  10. bool? excludeFromSemantics,
  11. Decoration? decoration,
  12. TextStyle? textStyle,
  13. TextAlign? textAlign,
  14. Duration? waitDuration,
  15. Duration? showDuration,
  16. Duration? exitDuration,
  17. bool enableTapToDismiss = true,
  18. TooltipTriggerMode? triggerMode,
  19. bool? enableFeedback,
  20. TooltipTriggeredCallback? onTriggered,
  21. MouseCursor? mouseCursor,
  22. bool? ignorePointer,
  23. Widget? child,
})

Creates a tooltip.

By default, tooltips should adhere to the Material specification. If the optional constructor parameters are not defined, the values provided by TooltipTheme.of will be used if a TooltipTheme is present or specified in ThemeData.

All parameters that are defined in the constructor will override the default values and the values in TooltipTheme.of.

Only one of message and richMessage may be non-null.

Implementation

const Tooltip({
  super.key,
  this.message,
  this.richMessage,
  @Deprecated(
    'Use Tooltip.constraints instead. '
    'This feature was deprecated after v3.30.0-0.1.pre.',
  )
  this.height,
  this.constraints,
  this.padding,
  this.margin,
  this.verticalOffset,
  this.preferBelow,
  this.excludeFromSemantics,
  this.decoration,
  this.textStyle,
  this.textAlign,
  this.waitDuration,
  this.showDuration,
  this.exitDuration,
  this.enableTapToDismiss = true,
  this.triggerMode,
  this.enableFeedback,
  this.onTriggered,
  this.mouseCursor,
  this.ignorePointer,
  this.child,
}) : assert(
       (message == null) != (richMessage == null),
       'Either `message` or `richMessage` must be specified',
     ),
     assert(
       height == null || constraints == null,
       'Only one of `height` and `constraints` may be specified.',
     );