Attitude.fromMap constructor
- dynamic attitudeMap
Creates an Attitude instance from a map representation.
Typically used when deserializing attitude data received from the native platform.
The map should contain:
quaternion: A map with x, y, z, w valuestime: Optional timestamp (reserved for future use)accuracy: Optional accuracy value (reserved for future use)headingDegrees: The heading in degreesheadingRadians: The heading in radians
Implementation
factory Attitude.fromMap(dynamic attitudeMap) {
return Attitude(
quaternion: QuaternionExtension.fromMap(attitudeMap["quaternion"]),
time: attitudeMap["time"] as int?,
accuracy: attitudeMap["accuracy"] as double?,
headingDegrees: attitudeMap["headingDegrees"] as double,
headingRadians: attitudeMap["headingRadians"] as double);
}