☀️Good Morning
HomeProjectsBlogThe WallContact
Abdulwahed Aldaghir

{ Work, for Allah will observe your deeds, and so will His Messenger and the believers. }

Links

HomeProjectsBlogThe Wall

Legal

Privacy PolicyTerms of Use

Social

© 2026 Abdulwahed Aldaghir. All rights reserved.

Back to Projects
Open-source Flutter package

Precise Compass

precise_compass@0.1.0

An honest, high-accuracy Flutter compass with continuous heading uncertainty, confidence scoring, sensor fusion, and reliable calibration detection.

View on pub.devSource codeDocumentation
pub.dev

Flutter plugin

precise_compass

v0.1.0MITOpen source
$flutter pub add precise_compass

160/160

Pub points

3

Likes

113

30-day downloads

About the package

Precise Compass is an open-source Flutter plugin for apps that need to know whether a heading can be trusted, not just what the heading is. It normalizes Android and iOS sensor data into a clear reading with heading, continuous accuracy in degrees, a confidence score, stable calibration guidance, and graceful behavior when compass hardware is unavailable.

What the package provides

Continuous heading accuracy in degrees instead of coarse status buckets
A 0–1 confidence score combining source quality, heading stability, and field health
Magnetic-interference detection based on field magnitude
Debounced calibration guidance with hysteresis to prevent flicker
Multiple sensor-fusion modes with an automatic recommended mode
Device capability introspection plus true and magnetic heading support
A safe API that never throws simply because compass hardware is missing

Built with

Flutter
Dart
Kotlin
Swift

Documentation

Read a trustworthy heading

Listen to the heading stream, then use its accuracy and confidence to decide when to display a direction and when to guide the user through calibration.

Read a trustworthy heading
import 'package:precise_compass/precise_compass.dart';

final subscription = PreciseCompass.heading.listen((reading) {
  if (!reading.hasHeading) return;

  print('${reading.heading.toStringAsFixed(0)}° '
      '± ${reading.accuracyDegrees.toStringAsFixed(0)}° '
      '· ${(reading.confidence * 100).toStringAsFixed(0)}% confident');

  if (reading.shouldCalibrate) {
    // Ask the user to move the device in a figure eight.
  }
});

await subscription.cancel();

Explore the full documentation

Browse the API reference, usage examples, and integration guidance for the selected package.

Documentation

Installation

Use the installation option for your environment, then import the public API.

Install command
flutter pub add precise_compass
pubspec.yaml
dependencies:
  precise_compass: ^0.1.0
Import
import 'package:precise_compass/precise_compass.dart';

Package details

Version
v0.1.0
Published
June 29, 2026
Registry
pub.dev
Publisher
awrs.me
SDK
Dart >=3.4.0 <4.0.0 · Flutter >=3.10.0
License
MIT
Null safeDart 3 compatibleWASM readyMIT

Supported platforms

Android
iOS
Report an issue