diff --git a/packages/stream_chat_v1/lib/home_page.dart b/packages/stream_chat_v1/lib/home_page.dart index abe14f1..828230f 100644 --- a/packages/stream_chat_v1/lib/home_page.dart +++ b/packages/stream_chat_v1/lib/home_page.dart @@ -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 { final GlobalKey _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;