Search packages, repositories and app categories

Package detailsv0.8.1

flutter_compass

A Flutter compass. The heading varies from 0-360, 0 being north.

AndroidiOS
30-day downloads
106K
Likes
191
Pub points
150

Install package

flutter pub add flutter_compass

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package that provides access to the device's compass sensor, delivering real-time heading values from 0 to 360 degrees, where 0 represents north. It enables apps to detect directional orientation using the device's built-in magnetometer. The package is compatible with both Android and iOS platforms and integrates seamlessly into Flutter applications. Developers can use it to build navigation tools, augmented reality features, or any app requiring directional awareness.

Use cases

  • Navigation apps
  • Augmented reality experiences
  • Directional UI indicators
  • Outdoor activity tracking
  • Map-based applications

Key features

  • Real-time heading updates
  • 0-360 degree orientation
  • Cross-platform support (Android & iOS)
  • Simple API integration
  • Magnetometer-based sensing

Suitable for

  • Developers building location-aware apps
  • Apps needing real-time direction data
  • Educational tools for geography
  • Hiking and outdoor navigation apps

Considerations

  • Requires device with a magnetometer
  • May need calibration in some environments
  • Accuracy can be affected by magnetic interference
  • Limited functionality on devices without sensors

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

flutter_compass

pub package

A Flutter compass. The heading varies from 0-360, 0 being north.

Note: Android Only: null is returned as direction on android when no sensor available.

Usage

To use this plugin, add flutter_compass as a dependency in your pubspec.yaml file. For example:

dependencies:
  flutter_compass: '^0.8.1'
iOS

Make sure to add keys with appropriate descriptions to the Info.plist file.

  • NSLocationWhenInUseUsageDescription
  • NSLocationAlwaysAndWhenInUseUsageDescription

:memo: Reference example code

Android

Make sure to add permissions to the app/src/main/AndroidManifest.xml file.

  • android.permission.INTERNET
  • android.permission.ACCESS_COARSE_LOCATION
  • android.permission.ACCESS_FINE_LOCATION

:memo: Reference example code

Recommended support plugins

:memo: Reference example code

Categories

Source repository

Projects using this package