Compass class
Class that handles the compass of the terminal.
The acquisition is initiated by doing listen.
It monitors the data at each interval and calls notifyListeners if it has been updated.
CompassData is stored in value, so refer to it.
Terminate acquisition with unlisten.
端末のコンパスを取り扱うクラス。
listenを行うことで取得を開始します。
インターバルごとにデータを監視し更新されていればnotifyListenersを呼び出します。
valueにCompassDataが格納されるのでそこを参照してください。
unlistenで取得を終了します。
- Inheritance
-
- Object
- ChangeNotifier
- MasamuneControllerBase<
CompassData?, LocationMasamuneAdapter> - Compass
Constructors
- Compass({LocationMasamuneAdapter? adapter})
- Class that handles the compass of the terminal.
Properties
- adapter → LocationMasamuneAdapter
-
TAdapter
to be used.no setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- initialized → bool
-
Returns
true
if initialized by executing initialize.no setter - listening → bool
-
Returns
true
if listen has already been executed.no setter - permitted → bool
-
If permission is granted by executing initialize, returns
true
.no setter - primaryAdapter → LocationMasamuneAdapter
-
Specifies the default
TAdapter
if adapter is Null.no setteroverride - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → CompassData?
-
The current value of the object. When the value changes, the callbacks
registered with addListener will be invoked.
no setteroverride
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
override
-
initialize(
{Duration timeout = const Duration(seconds: 60)}) → Future< void> - Initialization.
-
listen(
{Duration updateInterval = const Duration(minutes: 1), Duration timeout = const Duration(seconds: 60)}) → Future< void> - Starts acquiring compass data.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
setValueInternal(
CompassData? value) → void -
Set method is used to update the current state.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unlisten(
) → void - Cancel acquisition of CompassData.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- query → const _$CompassQuery
- Query for Compass.