create static method

BoxConstraints create(
  1. Axis axis, {
  2. double minCross = 0.0,
  3. double maxCross = double.infinity,
  4. double minMain = 0.0,
  5. double maxMain = double.infinity,
})

Creates box constraints with the given constraints.

Implementation

static BoxConstraints create(
  Axis axis, {
  double minCross = 0.0,
  double maxCross = double.infinity,
  double minMain = 0.0,
  double maxMain = double.infinity,
}) {
  return axis == Axis.vertical
      ? BoxConstraints(
          minWidth: minCross,
          maxWidth: maxCross,
          minHeight: minMain,
          maxHeight: maxMain,
        )
      : BoxConstraints(
          minWidth: minMain,
          maxWidth: maxMain,
          minHeight: minCross,
          maxHeight: maxCross,
        );
}