create static method

Size create(
  1. Axis axis,
  2. double cross,
  3. double main
)

Creates a Size with the given cross and main extents.

Implementation

static Size create(Axis axis, double cross, double main) {
  return axis == Axis.vertical ? Size(cross, main) : Size(main, cross);
}