TooltipModifier constructor

const TooltipModifier({
  1. Key? key,
  2. Key? modifierKey,
  3. Widget? child,
  4. String? message,
  5. InlineSpan? richMessage,
  6. double? height,
  7. EdgeInsetsGeometry? padding,
  8. EdgeInsetsGeometry? margin,
  9. double? verticalOffset,
  10. bool? preferBelow,
  11. bool? excludeFromSemantics,
  12. Decoration? decoration,
  13. TextStyle? textStyle,
  14. TextAlign? textAlign,
  15. Duration? waitDuration,
  16. Duration? showDuration,
  17. TooltipTriggerMode? triggerMode,
  18. bool? enableFeedback,
  19. TooltipTriggeredCallback? onTriggered,
})

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 TooltipModifier({
  super.key,
  super.modifierKey,
  super.child,
  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.triggerMode,
  this.enableFeedback,
  this.onTriggered,
})  : 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.',
      );