From ae7979c4239be0c212c72e0e5569a795a39da741 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Fri, 13 Mar 2020 09:27:55 +0100 Subject: [PATCH 1/2] 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(); From 0952c0d5e17156ae1d2e3c2b02885c40c5b8d14e Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Fri, 13 Mar 2020 09:29:45 +0100 Subject: [PATCH 2/2] version bump --- CHANGELOG.md | 4 ++++ README.md | 2 +- pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4b7ea55..cd82fe8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.10 + +- Do not automatically dispose Client object when disposing StreamChat widget + ## 0.1.9 - Fix message ui overflow diff --git a/README.md b/README.md index 86fe3a40..564fb165 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ The example is available under the [example](https://github.com/GetStream/stream ```yaml dependencies: - stream_chat_flutter: ^0.1.7 + stream_chat_flutter: ^0.1.10 ``` You should then run `flutter packages get` diff --git a/pubspec.yaml b/pubspec.yaml index b7c2cdf9..725236c4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: stream_chat_flutter homepage: https://github.com/GetStream/stream-chat-flutter description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter. -version: 0.1.9 +version: 0.1.10 environment: sdk: ">=2.3.0 <3.0.0"