create static method

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

Creates an offset with the specified cross and main components.

Implementation

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