From f789975844b69f1aca1b96a46ccb735813268834 Mon Sep 17 00:00:00 2001 From: xsahil03x Date: Mon, 23 Nov 2020 17:51:37 +0530 Subject: [PATCH] Open new chat screen page when new chat button is pressed. --- example/lib/main.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 7592cfab..9bcf63b5 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -69,7 +69,15 @@ class ChannelListPage extends StatelessWidget { Widget build(BuildContext context) { final user = StreamChat.of(context).user; return Scaffold( - appBar: ChannelListHeader(), + appBar: ChannelListHeader( + onNewChatButtonTap: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => NewChatScreen(), + ), + ); + }, + ), drawer: _buildDrawer(context, user), drawerEdgeDragWidth: 50, body: ChannelsBloc(