compassx
1.0.1, released 3 years ago by midoridesign.studio
Flutter compass plugin offering true heading, accuracy, and calibration needs.
WASM-ready
What it does
Provides reliable compass data streams including heading relative to true north, sensor accuracy, and calibration requirements. It supports Android and iOS platforms.
AI-written summary of version 1.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to display true heading or orientation relative to north in your app.
- You want to check if the device compass needs calibration.
Skip it when
- You are running tests exclusively on iOS simulators, which cannot use the heading sensor.
- Your app requires heading support in landscape orientation, as heading currently only supports portrait mode.
Strengths
- Provides accuracy metrics and calibration indicators.
- Stream-based API integrates easily with Flutter widgets.
Weaknesses
- Heading currently supports only portrait mode.
- Requires real device testing as iOS simulators cannot use the heading sensor.
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 0
Requires setting minimum SDK (iOS 12, Android 21), configuring location permissions via permission_handler and AndroidManifest.xml for Android, and fixing device orientation to portrait.
StreamBuilder<CompassXEvent>(
stream: CompassX.events,
builder: (context, snapshot) {
if (!snapshot.hasData) return const Text('No data');
final compass = snapshot.data!;
return Text('Heading: ${compass.heading}');
},
)Alternatives
Packages that do the same job and could replace compassx.
- sensors_plus
Provides access to standard device sensors like accelerometer, magnetometer, gyroscope, and user accelerometer.
96Compare