easy_compass

Creator: coderz1093

Last updated:

0 purchases

easy_compass Image
easy_compass Images

Languages

Categories

Add to Cart

Description:

easy compass

EasyCompass #
A Flutter package for accessing and displaying compass heading information. This package provides a
simple and convenient way to retrieve the compass heading using the device's magnetometer sensor and
display it visually.

Features #

Stream compass events with heading information

Getting Started #
To use this package, add easy_compass as a dependency in your pubspec.yaml file.
Usage #
Import the easy_compass package:
import 'package:easy_compass/easy_compass.dart';
copied to clipboard
Stream Compass Events #
Use the EasyCompass.stream getter to access the compass event stream. The stream
emits CompassEvent objects with the heading information.

Stream<CompassEvent> compassStream = EasyCompass().stream;
copied to clipboard
Display Compass Heading #
Subscribe to the compass event stream and update your UI to display the compass heading. For
example, you can use the Transform.rotate widget to rotate an image based on the heading:
StreamBuilder<CompassEvent>(
stream: compassStream,
builder: (context, snapshot) {
final heading = snapshot.data?.heading ?? 0;

return Transform.rotate(
angle: -heading * (math.pi / 180),
child: Image.asset('assets/compass.jpg'),
);
},
)
copied to clipboard
Additional Information #
For more information about the EasyCompass package, please refer to
the documentation.
Contribution #
We welcome contributions! If you find a bug or have a feature request,
please open an issue on GitHub. If you would like to
contribute code, create a pull request with your
changes.
License #
This package is licensed under the MIT License.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.