heading property
Heading, angle of rotation about the -Z axis (in radians).
This value represents the angle between the device's Y
axis and the magnetic north pole. When facing north, this
angle is 0, when facing south, this angle is pi.
Likewise, when facing east, this angle is pi/2, and
when facing west, this angle is -pi/2. The range of
values is -pi, pi.
Example:
// Get heading (angle of rotation about the -Z axis in radians)
double? heading = position.heading;
if (heading != null) {
print("Heading: $heading radians");
}
Implementation
double? heading;