maybeWrapWithTooltip function

Widget maybeWrapWithTooltip({
  1. required String? tooltip,
  2. EdgeInsetsGeometry? tooltipPadding,
  3. required Widget child,
})

Helper that will wrap child in a DevToolsTooltip widget if tooltip is non-null.

Implementation

Widget maybeWrapWithTooltip({
  required String? tooltip,
  EdgeInsetsGeometry? tooltipPadding,
  required Widget child,
}) {
  if (tooltip != null && tooltip.isNotEmpty) {
    return DevToolsTooltip(
      message: tooltip,
      padding: tooltipPadding,
      child: child,
    );
  }
  return child;
}