Accelerometer class Input

Provides access to the device's accelerometer data, including the force of gravity.

Constructors

Accelerometer(HTMLCanvasElement canvas, Mouse mouse, [bool autoRequestAccelerometerPermission = false])
Creates an Accelerometer instance and starts listening for device motion events. Typically, you don't instantiate this class yourself. Instead, you use the app.accelerometer member provided by the App class.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
x double
The acceleration force along the x-axis, adjusted for screen orientation.
getter/setter pair
y double
The acceleration force along the y-axis, adjusted for screen orientation.
getter/setter pair
z double
The acceleration force along the z-axis.
getter/setter pair

Methods

dispose() → dynamic
Stops listening for device motion events and cleans up resources.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestPermission() Future<bool>
This is required on iOS 13+ to retrieve data from the gyroscope. It only works if it is called after a user interaction.
toString() String
A string representation of this object.
inherited

Operators

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