Widget hasUnconstrainedBox(Widget widget) { if (width == double.infinity) { return widget; } else { return UnconstrainedBox( child: widget, ); } }