tooltip static method

Widget tooltip(
  1. dynamic context, {
  2. IconData? icon,
  3. double? iconSize,
  4. String? message,
})

Implementation

static Widget tooltip(context,
    {IconData? icon, double? iconSize, String? message}) {
  return Tooltip(
    message: message ?? '',
    padding: const EdgeInsets.all(10),
    decoration: BoxDecoration(
      color: Colors.black.withOpacity(0.9),
      borderRadius: const BorderRadius.all(Radius.circular(4)),
      border: Border.all(
        color: Colors.white54,
        width: 1,
      ),
    ),
    textStyle:
        Theme.of(context).textTheme.bodySmall!.copyWith(color: Colors.white),
    preferBelow: true,
    verticalOffset: 20,
    child: Icon(
      icon ?? CupertinoIcons.info,
      size: iconSize ?? 14.0,
      color: Theme.of(context).colorScheme.secondary.withOpacity(0.4),
    ),
  );
}