expandedIf method

Widget expandedIf(
  1. bool condition, {
  2. int flex = 1,
})

Wraps this widget with Expanded if condition is true, otherwise returns this widget.

Implementation

Widget expandedIf(bool condition, {int flex = 1}) =>
    condition ? Expanded(flex: flex, child: this) : this;