flipAxis function Null safety

Axis flipAxis(
  1. Axis direction
)

Returns the opposite of the given Axis.

Specifically, returns Axis.horizontal for Axis.vertical, and vice versa.

See also:

Implementation

Axis flipAxis(Axis direction) {
  assert(direction != null);
  switch (direction) {
    case Axis.horizontal:
      return Axis.vertical;
    case Axis.vertical:
      return Axis.horizontal;
  }
}