From 53d75e17c5f3e85ad88f09ddb809d637dff3a230 Mon Sep 17 00:00:00 2001 From: Soufiane Ben Yaala <59481648+soufianebenyaala@users.noreply.github.com> Date: Wed, 21 Aug 2024 10:42:53 +0100 Subject: [PATCH] fix When unsubscribe From SSE the _retryConnection method must stop --- lib/flutter_client_sse.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/flutter_client_sse.dart b/lib/flutter_client_sse.dart index c243951..34a3ce6 100644 --- a/lib/flutter_client_sse.dart +++ b/lib/flutter_client_sse.dart @@ -23,6 +23,7 @@ class SSEClient { required Map header, Map? body}) { print('---RETRY CONNECTION---'); + if (!_streamController.isClosed) Future.delayed(Duration(seconds: 5), () { subscribeToSSE( method: method,