AccelerometerDatum class

A Datum that holds acceleration data collected from the native accelerometer on the phone. Accelerometers measure the velocity of the device. Note that these readings include the effects of gravity. Put simply, you can use accelerometer readings to tell if the device is moving in a particular direction.

Inheritance
Annotations
  • @JsonSerializable(fieldRename: FieldRename.snake, includeIfNull: false)

Constructors

AccelerometerDatum({bool multiDatum = false, double? x, double? y, double? z})
AccelerometerDatum.fromAccelerometerEvent(AccelerometerEvent event, {bool multiDatum = false})
factory
AccelerometerDatum.fromJson(Map<String, dynamic> json)
factory

Properties

format ↔ DataFormat
The DataFormat of this type of Datum.
getter/setter pairinherited-setteroverride-getter
hashCode int
The hash code for this object.
no setterinherited
id String?
An identifier for this Datum, unique across all data generated. If this datum is part of a MultiDatum, then this id is null.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp DateTime
The UTC timestamp when this data was generated on the device.
getter/setter pairinherited
x double?
Acceleration force along the x axis (including gravity) measured in m/s^2.
getter/setter pair
y double?
Acceleration force along the y axis (including gravity) measured in m/s^2.
getter/setter pair
z double?
Acceleration force along the z axis (including gravity) measured in m/s^2.
getter/setter pair

Methods

equivalentTo(ConditionalEvent? event) bool
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Return a JSON encoding of this datum.
override
toString() String
A string representation of this object.
override

Operators

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