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. Duration? waitDuration,
  13. Duration? showDuration,
  14. Widget? child,
  15. TooltipTriggerMode? triggerMode,
  16. bool? enableFeedback}
)

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({
  Key? key,
  this.message,
  this.richMessage,
  this.height,
  this.padding,
  this.margin,
  this.verticalOffset,
  this.preferBelow,
  this.excludeFromSemantics,
  this.decoration,
  this.textStyle,
  this.waitDuration,
  this.showDuration,
  this.child,
  this.triggerMode,
  this.enableFeedback,
}) :  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.',
      ),
      super(key: key);