Tooltip constructor Null safety

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. TooltipTriggerMode? triggerMode,
  16. bool? enableFeedback,
  17. TooltipTriggeredCallback? onTriggered,
  18. 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.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.',
      );