fix homepage

This commit is contained in:
Salvatore Giordano
2021-07-01 08:55:12 +02:00
parent 9cd670b6a7
commit 52e19e9bc1
+8 -2
View File
@@ -10,19 +10,25 @@ class HomePageArgs {
HomePageArgs(this.chatClient);
}
class HomePage extends StatelessWidget {
class HomePage extends StatefulWidget {
HomePage({
Key? key,
required this.chatClient,
}) : super(key: key);
final StreamChatClient chatClient;
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
final GlobalKey<NavigatorState> _navigatorKey = GlobalKey();
@override
Widget build(BuildContext context) {
return StreamChat(
client: chatClient,
client: widget.chatClient,
child: WillPopScope(
onWillPop: () async {
final canPop = await _navigatorKey.currentState?.maybePop() ?? false;