add automatickeepalive to streamchat

This commit is contained in:
Salvatore Giordano
2020-04-01 10:31:39 +02:00
parent 9f95012f06
commit be495d8d86
+5 -1
View File
@@ -59,7 +59,8 @@ class StreamChat extends StatefulWidget {
} }
} }
class StreamChatState extends State<StreamChat> { class StreamChatState extends State<StreamChat>
with AutomaticKeepAliveClientMixin {
final List<StreamSubscription> _subscriptions = []; final List<StreamSubscription> _subscriptions = [];
Client get client => widget.client; Client get client => widget.client;
final GlobalKey<NavigatorState> _navigatorKey = GlobalKey<NavigatorState>(); final GlobalKey<NavigatorState> _navigatorKey = GlobalKey<NavigatorState>();
@@ -245,4 +246,7 @@ class StreamChatState extends State<StreamChat> {
_channelsController.close(); _channelsController.close();
super.dispose(); super.dispose();
} }
@override
bool get wantKeepAlive => true;
} }