simulateReconnected method

void simulateReconnected({
  1. Duration downtime = Duration.zero,
  2. int attempts = 1,
  3. bool resumed = false,
})

Simulates the connection coming back after a drop, on reconnectedStream.

Implementation

void simulateReconnected({
  Duration downtime = Duration.zero,
  int attempts = 1,
  bool resumed = false,
}) {
  _connectionId ??= 'fake-conn-${DateTime.now().millisecondsSinceEpoch}';
  _reconnectedController.add(RealtimeReconnection(
    connectionId: _connectionId!,
    downtime: downtime,
    attempts: attempts,
    resumed: resumed,
  ));
}