SmartphoneSensor class

Smartphone sensor implementation using sensors_plus.

This class provides access to smartphone IMU sensors using the sensors_plus package. Streams accelerometer, gyroscope, and magnetometer data from the device's built-in sensors.

Acts as a singleton and implements the Sensor interface, allowing it to be used interchangeably with other sensor types (e.g., MovesenseSensor) in the mobility package.

Sampling rates are limited by the device hardware and operating system.

Implemented types

Constructors

SmartphoneSensor.new()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startAccelerometer(double samplingRate) Future<Stream<SensorEvent>>
Starts streaming accelerometer data from the smartphone at the given samplingRate (Hz). Returns a stream of SensorEvents.
override
startGyroscope(double samplingRate) Future<Stream<SensorEvent>>
Starts streaming gyroscope data from the smartphone at the given samplingRate (Hz). Returns a stream of SensorEvents.
override
startMagnetometer(double samplingRate) Future<Stream<SensorEvent>>
Starts streaming magnetometer data from the smartphone at the given samplingRate (Hz). Returns a stream of SensorEvents.
override
stopAccelerometer() Future<void>
Stops streaming accelerometer data from the smartphone.
override
stopGyroscope() Future<void>
Stops streaming gyroscope data from the smartphone.
override
stopMagnetometer() Future<void>
Stops streaming magnetometer data from the smartphone.
override
toString() String
A string representation of this object.
inherited

Operators

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