TrueCompassWeb class

Web implementation built on DeviceOrientationEvent.

Chrome and Android browsers expose absolute orientation through the deviceorientationabsolute event. iOS Safari exposes webkitCompassHeading and requires a permission prompt that must be started from a user gesture. Pages must be served over HTTPS.

Inheritance

Constructors

TrueCompassWeb()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkAvailability() → Future<CompassAvailability>
Whether the compass can be used.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rawEvents(RawSensorConfig config) → Stream<Map<String, Object?>>
Raw sensor events. The sensor runs only while the stream is listened to.
override
requestPermission() → Future<CompassAvailability>
Asks the user for sensor permission where the platform needs it.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

registerWith(Registrar registrar) → void
Registers this class as the web implementation.