gyroscopeEvents top-level property Null safety

Stream<GyroscopeEvent>? gyroscopeEvents

A broadcast stream of events from the device gyroscope.

Implementation

Stream<GyroscopeEvent>? get gyroscopeEvents {
  if (_gyroscopeEvents == null) {
    _gyroscopeEvents = _gyroscopeEventChannel
        .receiveBroadcastStream()
        .map((dynamic event) => _listToGyroscopeEvent(event.cast<double>()));
  }
  return _gyroscopeEvents;
}