maybeWidget static method

Widget maybeWidget({
  1. required WidgetWrapper wrapper,
  2. required Widget child,
  3. bool enabled = false,
})

Conditionally wraps the child with wrapper widget if enabled is true.

Implementation

static Widget maybeWidget(
        {required WidgetWrapper wrapper,
        required Widget child,
        bool enabled = false}) =>
    enabled ? wrapper(child) : child;