constrained method

Widget constrained({
  1. double maxWidth = 800,
})

Centers the widget and ensures its width does not exceed maxWidth.

Essential for preventing content stretching on large monitors.

Implementation

Widget constrained({double maxWidth = 800}) {
  return Center(
    child: ConstrainedBox(
      constraints: BoxConstraints(maxWidth: maxWidth),
      child: this,
    ),
  );
}