tooltipThemeData static method
TooltipThemeData
tooltipThemeData(
- Palette colors,
- TextTheme textTheme, [
- MonetShapes? shapes
])
Implementation
static TooltipThemeData tooltipThemeData(
Palette colors,
TextTheme textTheme, [
MonetShapes? shapes,
]) {
shapes ??= _defaultShapes;
return TooltipThemeData(
constraints: BoxConstraints(minHeight: 32),
padding: switch (defaultTargetPlatform) {
TargetPlatform.macOS ||
TargetPlatform.linux ||
TargetPlatform.windows => const EdgeInsets.symmetric(
horizontal: 8.0,
vertical: 4.0,
),
TargetPlatform.android ||
TargetPlatform.fuchsia ||
TargetPlatform.iOS => const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 4.0,
),
},
margin: EdgeInsets.zero,
verticalOffset: 24,
preferBelow: true,
excludeFromSemantics: false,
decoration: ShapeDecoration(
shape: shapes.border(
side: BorderSide(color: colors.colorBorder, width: 2),
),
color: colors.color,
),
textStyle: textTheme.bodySmall!.copyWith(color: colors.colorText),
textAlign: TextAlign.center,
showDuration: const Duration(seconds: 2),
waitDuration: const Duration(seconds: 1),
triggerMode: TooltipTriggerMode.longPress,
enableFeedback: true,
);
}