From ae7979c4239be0c212c72e0e5569a795a39da741 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Fri, 13 Mar 2020 09:27:55 +0100 Subject: [PATCH] fix issue #4 not disposing the client when disposing StreamChat widget --- example/lib/main.dart | 8 +++----- lib/src/stream_chat.dart | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index d4855068..9ccc10df 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -28,11 +28,9 @@ class MyApp extends StatelessWidget { brightness: Brightness.light, ), ), - home: Container( - child: StreamChat( - client: client, - child: ChannelListPage(), - ), + home: StreamChat( + client: client, + child: ChannelListPage(), ), ); } diff --git a/lib/src/stream_chat.dart b/lib/src/stream_chat.dart index ecdcda0e..f7eabff9 100644 --- a/lib/src/stream_chat.dart +++ b/lib/src/stream_chat.dart @@ -240,7 +240,6 @@ class StreamChatState extends State { @override void dispose() { - widget.client.dispose(); _subscriptions.forEach((s) => s.cancel()); _queryChannelsLoadingController.close(); _channelsController.close();