fix issue #4 not disposing the client when disposing StreamChat widget
This commit is contained in:
@@ -28,11 +28,9 @@ class MyApp extends StatelessWidget {
|
|||||||
brightness: Brightness.light,
|
brightness: Brightness.light,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
home: Container(
|
home: StreamChat(
|
||||||
child: StreamChat(
|
client: client,
|
||||||
client: client,
|
child: ChannelListPage(),
|
||||||
child: ChannelListPage(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -240,7 +240,6 @@ class StreamChatState extends State<StreamChat> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
widget.client.dispose();
|
|
||||||
_subscriptions.forEach((s) => s.cancel());
|
_subscriptions.forEach((s) => s.cancel());
|
||||||
_queryChannelsLoadingController.close();
|
_queryChannelsLoadingController.close();
|
||||||
_channelsController.close();
|
_channelsController.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user