Skip to content
Articles
Article

heading_sensor: a compass heading for Flutter on Android, done carefully

by Abdeldjalil Chougui dev.to

5 min read

A compass screen looks simple: read a number between 0 and 360, rotate a needle. The number is the easy part. The rest is where compass apps go wrong. The phone has several sensors that can give a heading, and they are not equally good. The heading has to follow the top of the screen, so it must change when the display rotates to landscape. A needle that is smoothed with a plain average spins the…

Forum

Questions about this, or something to add?

Discuss on the forum

Report this · Wrote this? Claim it

FlutterX is supported by