SensorReading.fromJson constructor

SensorReading.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory SensorReading.fromJson(Map<String, dynamic> json) {
  return SensorReading(
    single:
        json.containsKey('single')
            ? SensorReadingSingle.fromJson(
              json['single'] as Map<String, dynamic>,
            )
            : null,
    xyz:
        json.containsKey('xyz')
            ? SensorReadingXYZ.fromJson(json['xyz'] as Map<String, dynamic>)
            : null,
    quaternion:
        json.containsKey('quaternion')
            ? SensorReadingQuaternion.fromJson(
              json['quaternion'] as Map<String, dynamic>,
            )
            : null,
  );
}