Fixed onConnectionLost() when socket is already closed
MODIFY
lib/src/socket_client.dart
lib/src/socket_client.dart
@@ -129,6 +129,9 @@ class SocketClient {
print('Disconnected from websocket.');
_keepAliveSubscription?.cancel();
_messageSubscription?.cancel();
+
+ if (_connectionStateController.isClosed) return;
+
if (_connectionStateController.value != SocketConnectionState.NOT_CONNECTED)
_connectionStateController.value = SocketConnectionState.NOT_CONNECTED;

Fixed onConnectionLost() when socket is already closed