Tooltip constructor

const Tooltip({
  1. Key? key,
  2. String? message,
  3. InlineSpan? richMessage,
  4. double? height,
  5. EdgeInsetsGeometry? padding,
  6. EdgeInsetsGeometry? margin,
  7. double? verticalOffset,
  8. bool? preferBelow,
  9. bool? excludeFromSemantics,
  10. Decoration? decoration,
  11. TextStyle? textStyle,
  12. TextAlign? textAlign,
  13. Duration? waitDuration,
  14. Duration? showDuration,
  15. Duration? exitDuration,
  16. bool enableTapToDismiss = true,
  17. TooltipTriggerMode? triggerMode,
  18. bool? enableFeedback,
  19. TooltipTriggeredCallback? onTriggered,
  20. 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,
  this.height,
  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.child,
}) :  assert((message == null) != (richMessage == null), 'Either `message` or `richMessage` must be specified'),
      assert(
        richMessage == null || textStyle == null,
        'If `richMessage` is specified, `textStyle` will have no effect. '
        'If you wish to provide a `textStyle` for a rich tooltip, add the '
        '`textStyle` directly to the `richMessage` InlineSpan.',
      );