Skip to main content

headless_level 0.1.0 copy "headless_level: ^0.1.0" to clipboard
headless_level: ^0.1.0 copied to clipboard

Headless iOS level: a typed stream of the device gravity vector. No widgets, no exceptions, no permissions.

headless_level #

A headless level for iOS. No widgets — just a typed stream of the device gravity vector.

Usage #

final source = LevelSource();
if (await source.isAvailable()) {
  source.watch().listen((s) {
    print('${s.gx} ${s.gy} ${s.gz} — tilt ${s.tiltDeg}°');
  });
}

Coordinates #

The gravity vector is a unit vector in the device frame, straight from CMDeviceMotion.gravity:

Pose Vector
Flat on its back, screen up (0, 0, -1)
Upright in portrait (0, -1, 0)
Flat on its face, screen down (0, 0, 1)

tiltDeg is the angle between the back of the device and the horizontal plane, 0 to 180. It is derived from gz alone; the two horizontal components are what a bubble needs, which is why the raw vector is what this package returns.

Guarantees #

  • Never throws. A dead platform channel gives isAvailable() == false.
  • No widgets.
  • No permissions — CoreMotion asks for none.
  • iOS only. There is nothing to run on other platforms.

License #

MIT.

0
likes
0
points
27
downloads

Publisher

verified publisherlasoai.vn

Weekly Downloads

Headless iOS level: a typed stream of the device gravity vector. No widgets, no exceptions, no permissions.

Repository (GitHub)
View/report issues

Topics

#level #inclinometer #sensors #ios

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on headless_level

Packages that implement headless_level