on method

Stream<ChannelStateChange> on([
  1. ChannelEvent? channelEvent
])

Stream of channel events with specified ChannelEvent type

Implementation

Stream<ChannelStateChange> on([ChannelEvent? channelEvent]) =>
    listen<ChannelStateChange>(
      PlatformMethod.onRealtimeChannelStateChanged,
      {TxTransportKeys.channelName: _channelName},
    ).where(
      (stateChange) =>
          channelEvent == null || stateChange.event == channelEvent,
    );