proximityEvents top-level property Null safety

Stream<ProximityEvent>? proximityEvents

A broadcast stream of events from the device proximity.

Implementation

Stream<ProximityEvent>? get proximityEvents {
  _proximityEvents = _proximityEventChannel
      .receiveBroadcastStream()
      .map((dynamic event) => _listToProximityEvent(event.cast<double>()));

  return _proximityEvents;
}