TypingIndicatorTracker constructor

TypingIndicatorTracker({
  1. required RealtimeLifecycleClient client,
  2. required ClockPort clock,
  3. required SchedulerPort scheduler,
  4. void onChange(
    1. Set<String> typingActors
    )?,
})

Implementation

TypingIndicatorTracker({
  required RealtimeLifecycleClient client,
  required ClockPort clock,
  required SchedulerPort scheduler,
  void Function(Set<String> typingActors)? onChange,
})  : _clock = clock,
      _scheduler = scheduler,
      _onChange = onChange {
  _offStarted = client.on(presenceDomain, typingStartedType, _handleStarted);
  _offStopped = client.on(presenceDomain, typingStoppedType, _handleStopped);
  _offRoomChanged = client.onActiveRoomChanged((_) => clear());
  _offState = client.onStateChange((from, to) {
    if (to == LifecycleState.disconnected ||
        to == LifecycleState.reconnectWait) {
      clear();
    }
  });
}