DeviceOrientation enum

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.

Constants

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.

const DeviceOrientation(1)
landscapeRight → const DeviceOrientation

The orientation that is 90 degrees counterclockwise from portraitUp.

const DeviceOrientation(3)
portraitDown → const DeviceOrientation

The orientation that is 180 degrees from portraitUp.

const DeviceOrientation(2)
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.

const DeviceOrientation(0)
values → const List<DeviceOrientation>

A constant List of the values in this enum, in order of their declaration.

const List<DeviceOrientation>

Properties

index int

The integer index of this enum.

final
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

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

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited