conditionalWrap method

Widget conditionalWrap(
  1. bool condition,
  2. Widget wrapper(
    1. Widget child
    )
)

Conditionally wraps the widget with another widget

Implementation

Widget conditionalWrap(bool condition, Widget Function(Widget child) wrapper) {
  return condition ? wrapper(this) : this;
}