setTripStartListener method

  1. @override
Stream<DateTime> setTripStartListener()
override

Set a block to be invoked when a trip starts. Returns stream with the trip start date. The listener is sent delayed after confirming a trip is valid, around 30s to 130s.

Implementation

@override
Stream<DateTime> setTripStartListener() async* {
  yield* tripStartChannel
      .receiveBroadcastStream()
      .asyncMap<DateTime>((tripStart) {
    return DateTime.fromMillisecondsSinceEpoch(tripStart);
  });
}