Tooltip constructor
- Key? key,
- String? message,
- InlineSpan? richMessage,
- double? height,
- EdgeInsetsGeometry? padding,
- EdgeInsetsGeometry? margin,
- double? verticalOffset,
- bool? preferBelow,
- bool? excludeFromSemantics,
- Decoration? decoration,
- TextStyle? textStyle,
- TextAlign? textAlign,
- Duration? waitDuration,
- Duration? showDuration,
- Duration? exitDuration,
- bool enableTapToDismiss = true,
- TooltipTriggerMode? triggerMode,
- bool? enableFeedback,
- TooltipTriggeredCallback? onTriggered,
- 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.',
);