DeviceOrientation enum Null safety

Specifies a particular device orientation.

To determine which values correspond to which orientations, first position the device in its default orientation (this is the orientation that the system first uses for its boot logo, or the orientation in which the hardware logos or markings are upright, or the orientation in which the cameras are at the top). If this is a portrait orientation, then this is portraitUp. Otherwise, it's landscapeLeft. As you rotate the device by 90 degrees in a counter-clockwise direction around the axis that pierces the screen, you step through each value in this enum in the order given.

For a device with a landscape default orientation, the orientation obtained by rotating the device 90 degrees clockwise from its default orientation is portraitUp.

Used by SystemChrome.setPreferredOrientations.

Inheritance

Constructors

DeviceOrientation()
const

Values

portraitUp → const DeviceOrientation

If the device shows its boot logo in portrait, then the boot logo is shown in portraitUp. Otherwise, the device shows its boot logo in landscape and this orientation is obtained by rotating the device 90 degrees clockwise from its boot orientation.

DeviceOrientation()
landscapeLeft → const DeviceOrientation

The orientation that is 90 degrees clockwise from portraitUp.

If the device shows its boot logo in landscape, then the boot logo is shown in landscapeLeft.

DeviceOrientation()
portraitDown → const DeviceOrientation

The orientation that is 180 degrees from portraitUp.

DeviceOrientation()
landscapeRight → const DeviceOrientation

The orientation that is 90 degrees counterclockwise from portraitUp.

DeviceOrientation()

Properties

hashCode int
The hash code for this object.
read-only, inherited
index int
A numeric identifier for the enumerated value.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<DeviceOrientation>
A constant List of the values in this enum, in order of their declaration.
[portraitUp, landscapeLeft, portraitDown, landscapeRight]