addOrientationListener method

void addOrientationListener(
  1. OrientationListener listener
)
override

Adds an OrientationListener to the engine.

The listener is notified when a new orientation is available. Supports more than one listener. A listener is added only once.

  • listener The listener to be added.

Implementation

void addOrientationListener(OrientationListener listener) {
  if (!_orientationListeners.containsKey(listener)) {
    _orientationListeners[listener] = OrientationListenerBridge(listener);
  }
  _location.addOrientationListener(_orientationListeners[listener]!);
}