Sensor class

Represents a sensor.

See: https://developer.android.com/reference/android/hardware/Sensor

Constructors

Sensor({@required int key String name, int type })
const

Properties

key → int
An internal handle.
final
name → String
See: https://developer.android.com/reference/android/hardware/Sensor#getName()
final
type → int
See: https://developer.android.com/reference/android/hardware/Sensor#getType()
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

subscribe({int samplingPeriodUs int maxReportLatencyUs }) → Future<Stream<SensorEvent>>
Subscribes to this sensor's event stream. [...]
toString() → String
Returns a string representation of this object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited

Constants

REPORTING_MODE_CONTINUOUS → const int
Events are reported at a constant rate which is set by the rate parameter of SensorManager#registerListener(SensorEventListener, Sensor, int). [...]
0
REPORTING_MODE_ON_CHANGE → const int
Events are reported only when the value changes. [...]
1
REPORTING_MODE_ONE_SHOT → const int
Events are reported in one-shot mode. [...]
2
REPORTING_MODE_SPECIAL_TRIGGER → const int
Events are reported as described in the description of the sensor. [...]
3
STRING_TYPE_ACCELEROMETER → const String
A constant string describing an accelerometer sensor type. [...]
"android.sensor.accelerometer"
STRING_TYPE_ACCELEROMETER_UNCALIBRATED → const String
A constant string describing an uncalibrated accelerometer sensor. [...]
"android.sensor.accelerometer_uncalibrated"
STRING_TYPE_AMBIENT_TEMPERATURE → const String
A constant string describing an ambient temperature sensor type. [...]
"android.sensor.ambient_temperature"
STRING_TYPE_GAME_ROTATION_VECTOR → const String
A constant string describing an uncalibrated rotation vector sensor type. [...]
"android.sensor.game_rotation_vector"
STRING_TYPE_GEOMAGNETIC_ROTATION_VECTOR → const String
A constant string describing a geo-magnetic rotation vector. [...]
"android.sensor.geomagnetic_rotation_vector"
STRING_TYPE_GRAVITY → const String
A constant string describing a gravity sensor type. [...]
"android.sensor.gravity"
STRING_TYPE_GYROSCOPE → const String
A constant string describing a gyroscope sensor type. [...]
"android.sensor.gyroscope"
STRING_TYPE_GYROSCOPE_UNCALIBRATED → const String
A constant string describing an uncalibrated gyroscope sensor type. [...]
"android.sensor.gyroscope_uncalibrated"
STRING_TYPE_HEART_BEAT → const String
A constant string describing a heart beat sensor. [...]
"android.sensor.heart_beat"
STRING_TYPE_HEART_RATE → const String
A constant string describing a heart rate monitor. [...]
"android.sensor.heart_rate"
STRING_TYPE_LIGHT → const String
A constant string describing a light sensor type. [...]
"android.sensor.light"
STRING_TYPE_LINEAR_ACCELERATION → const String
A constant string describing a linear acceleration sensor type. [...]
"android.sensor.linear_acceleration"
STRING_TYPE_LOW_LATENCY_OFFBODY_DETECT → const String
A constant string describing a low-latency offbody detector sensor. [...]
"android.sensor.low_latency_offbody_detect"
STRING_TYPE_MAGNETIC_FIELD → const String
A constant string describing a magnetic field sensor type. [...]
"android.sensor.magnetic_field"
STRING_TYPE_MAGNETIC_FIELD_UNCALIBRATED → const String
A constant string describing an uncalibrated magnetic field sensor type. [...]
"android.sensor.magnetic_field_uncalibrated"
STRING_TYPE_MOTION_DETECT → const String
A constant string describing a motion detection sensor. [...]
"android.sensor.motion_detect"
STRING_TYPE_POSE_6DOF → const String
A constant string describing a pose sensor with 6 degrees of freedom. [...]
"android.sensor.pose_6dof"
STRING_TYPE_PRESSURE → const String
A constant string describing a pressure sensor type. [...]
"android.sensor.pressure"
STRING_TYPE_PROXIMITY → const String
A constant string describing a proximity sensor type. [...]
"android.sensor.proximity"
STRING_TYPE_RELATIVE_HUMIDITY → const String
A constant string describing a relative humidity sensor type. [...]
"android.sensor.relative_humidity"
STRING_TYPE_ROTATION_VECTOR → const String
A constant string describing a rotation vector sensor type. [...]
"android.sensor.rotation_vector"
STRING_TYPE_SIGNIFICANT_MOTION → const String
A constant string describing a significant motion trigger sensor. [...]
"android.sensor.significant_motion"
STRING_TYPE_STATIONARY_DETECT → const String
A constant string describing a stationary detection sensor. [...]
"android.sensor.stationary_detect"
STRING_TYPE_STEP_COUNTER → const String
A constant string describing a step counter sensor. [...]
"android.sensor.step_counter"
STRING_TYPE_STEP_DETECTOR → const String
A constant string describing a step detector sensor. [...]
"android.sensor.step_detector"
TYPE_ACCELEROMETER → const int
A constant describing an accelerometer sensor type. [...]
1
TYPE_ACCELEROMETER_UNCALIBRATED → const int
A constant describing an uncalibrated accelerometer sensor. [...]
35
TYPE_ALL → const int
A constant describing all sensor types. [...]
-1
TYPE_AMBIENT_TEMPERATURE → const int
A constant describing an ambient temperature sensor type. [...]
13
TYPE_DEVICE_PRIVATE_BASE → const int
The lowest sensor type vendor defined sensors can use. [...]
65536
TYPE_GAME_ROTATION_VECTOR → const int
A constant describing an uncalibrated rotation vector sensor type. [...]
15
TYPE_GEOMAGNETIC_ROTATION_VECTOR → const int
A constant describing a geo-magnetic rotation vector. [...]
20
TYPE_GRAVITY → const int
A constant describing a gravity sensor type. [...]
9
TYPE_GYROSCOPE → const int
A constant describing a gyroscope sensor type. [...]
4
TYPE_GYROSCOPE_UNCALIBRATED → const int
A constant describing an uncalibrated gyroscope sensor type. [...]
16
TYPE_HEART_BEAT → const int
A constant describing a motion detect sensor. [...]
31
TYPE_HEART_RATE → const int
A constant describing a heart rate monitor. [...]
21
TYPE_LIGHT → const int
A constant describing a light sensor type. [...]
5
TYPE_LINEAR_ACCELERATION → const int
A constant describing a linear acceleration sensor type. [...]
10
TYPE_LOW_LATENCY_OFFBODY_DETECT → const int
A constant describing a low latency off-body detect sensor. [...]
34
TYPE_MAGNETIC_FIELD → const int
A constant describing a magnetic field sensor type. [...]
2
TYPE_MAGNETIC_FIELD_UNCALIBRATED → const int
A constant describing an uncalibrated magnetic field sensor type. [...]
14
TYPE_MOTION_DETECT → const int
A constant describing a motion detect sensor. [...]
30
TYPE_POSE_6DOF → const int
A constant describing a pose sensor with 6 degrees of freedom. [...]
28
TYPE_PRESSURE → const int
A constant describing a pressure sensor type. [...]
6
TYPE_PROXIMITY → const int
A constant describing a proximity sensor type. [...]
8
TYPE_RELATIVE_HUMIDITY → const int
A constant describing a relative humidity sensor type. [...]
12
TYPE_ROTATION_VECTOR → const int
A constant describing a rotation vector sensor type. [...]
11
TYPE_SIGNIFICANT_MOTION → const int
A constant describing a significant motion trigger sensor. [...]
17
TYPE_STATIONARY_DETECT → const int
A constant describing a stationary detect sensor. [...]
29
TYPE_STEP_COUNTER → const int
A constant describing a step counter sensor. [...]
19
TYPE_STEP_DETECTOR → const int
A constant describing a step detector sensor. [...]
18