Accelerometer class Input
Provides access to the device's accelerometer data, including the force of gravity.
On SDL3 desktop platforms this is a no-op (x, y, z are always 0.0).
Constructors
- Accelerometer(AccelerometerBackend _backend, Mouse mouse, [bool autoRequestAccelerometerPermission = false])
- Creates an Accelerometer instance.
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.
no setter
- y → double
-
The acceleration force along the y-axis, adjusted for screen orientation.
no setter
- z → double
-
The acceleration force along the z-axis.
no setter
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> - Requests accelerometer permission (required on iOS 13+). Must be called after a user interaction.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited