Widget wrapIf(bool condition, Widget Function(Widget) wrapper) { if (condition) { return wrapper(this); } return this; }