accelerometerEvents top-level property Null safety

Stream<AccelerometerEvent>? accelerometerEvents

A broadcast stream of events from the device accelerometer.

Implementation

Stream<AccelerometerEvent>? get accelerometerEvents {
  if (_accelerometerEvents == null) {
    _accelerometerEvents = _accelerometerEventChannel
        .receiveBroadcastStream()
        .map(
            (dynamic event) => _listToAccelerometerEvent(event.cast<double>()));
  }
  return _accelerometerEvents;
}