DeviceOrientationEvent class Null safety

Experimental This is an experimental technologyCheck the Browser compatibility table carefully before using this in production. The provides web developers with information from the physical orientation of the device running the web page.

Mixed in types
Annotations

Constructors

DeviceOrientationEvent(String type, [DeviceOrientationEventInit? eventInitDict])
factory

Properties

absolute bool
A boolean that indicates whether or not the device is providing orientation data absolutely.
read-only
alpha double?
A number representing the motion of the device around the z axis, express in degrees with values ranging from 0 (inclusive) to 360 (exclusive).
read-only
beta double?
A number representing the motion of the device around the x axis, express in degrees with values ranging from -180 (inclusive) to 180 (exclusive). This represents a front to back motion of the device.
read-only
bubbles bool
A boolean indicating whether or not the event bubbles up through the DOM.
read-only, inherited
cancelable bool
A boolean indicating whether the event is cancelable.
read-only, inherited
cancelBubble bool
A historical alias to Event.stopPropagation(). Setting its value to true before returning from an event handler prevents propagation of the event.
read / write, inherited
composed bool
A boolean indicating whether or not the event can bubble across the boundary between the shadow DOM and the regular DOM.
read-only, inherited
currentTarget EventTarget?
A reference to the currently registered target for the event. This is the object to which the event is currently slated to be sent. It's possible this has been changed along the way through retargeting.
read-only, inherited
defaultPrevented bool
Indicates whether or not the call to event.preventDefault() canceled the event.
read-only, inherited
eventPhase int
Indicates which phase of the event flow is being processed.
read-only, inherited
gamma double?
A number representing the motion of the device around the y axis, express in degrees with values ranging from -90 (inclusive) to 90 (exclusive). This represents a left to right motion of the device.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
isTrusted bool
Indicates whether or not the event was initiated by the browser (after a user click, for instance) or by a script (using an event creation method, like Event.initEvent).
read-only, inherited
returnValue ↔ dynamic
A historical property introduced by Internet Explorer and eventually adopted into the DOM specification in order to ensure existing sites continue to work. Ideally, you should try to use Event.preventDefault() and Event.defaultPrevented instead, but you can use if you choose to do so.
covariant, read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
srcElement EventTarget?
A non-standard alias (from old versions of Microsoft Internet Explorer) for Event.target. Some other browsers are starting to support it for web compatibility purposes.
read-only, inherited
target EventTarget?
A reference to the target to which the event was originally dispatched.
read-only, inherited
timeStamp double
The time at which the event was created (in milliseconds). By specification, this value is time since epoch—but in reality, browsers' definitions vary. In addition, work is underway to change this to be a DOMHighResTimeStamp instead.
read-only, inherited
type String
The name of the event. Case-insensitive.
read-only, inherited

Methods

composedPath() Iterable<EventTarget>
Returns the event’s path (objects on which listeners will be invoked). This does not include nodes in shadow trees if the shadow root was created with its ShadowRoot.mode closed. var composed = Event.composedPath();
inherited
initEvent(String type, [bool? bubbles = false, bool? cancelable = false]) Object
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
preventDefault() Object
Cancels the event (if it is cancelable). event.preventDefault();
inherited
stopImmediatePropagation() Object
For this particular event, prevent all other listeners from being called. This includes listeners attached to the same element as well as those attached to elements that will be traversed later (during the capture phase, for instance). event.stopImmediatePropagation();
inherited
stopPropagation() Object
Stops the propagation of events further along in the DOM. event.stopPropagation();
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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

Static Methods

requestPermission() Promise<PermissionState>