barQuarterTurns function

int barQuarterTurns(
  1. DeviceOrientation orientation
)

Quarter-turns (clockwise) to rotate a top-bar widget so it reads upright when the device is in landscape. Use with RotatedBox(quarterTurns: ...).

Returns 0 for portrait (up or down), 1 for landscape-left, 3 for landscape-right.

Implementation

int barQuarterTurns(DeviceOrientation orientation) {
  return switch (orientation) {
    DeviceOrientation.landscapeLeft => 1,
    DeviceOrientation.landscapeRight => 3,
    _ => 0,
  };
}