maybeTooltip static method

Widget maybeTooltip({
  1. required Widget child,
  2. String? message,
})

Conditionally wraps the child with Tooltip widget if message is not null and not empty.

Implementation

static Widget maybeTooltip({required Widget child, String? message}) =>
    (message ?? '').isNotEmpty
        ? Tooltip(message: message!, child: child)
        : child;