Closed ChiragGajjar closed 2 years ago
Hi is this in the sample app? can you give me more information?
Yes, but I am not using MaterialApp, because I have my own custom navigation.
yeah but you still need a StreamChat widget on top of your widget tree? did you add that?
Yes, Check my code here
return StreamChat( client: client, streamChatThemeData: StreamChatThemeData.fromTheme(theme), child: ChannelListPage(client: client,), );
The StreamChat widget should be on top of the navigator because it needs to be retrievable by other widgets in every route Can you try moving it above the navigator?
Like this? This is working fine, it shows a nested view but I don't use this MaterialApp because i have my custom header.
return Scaffold( body: MaterialApp( builder: (context, child) => StreamChat( client: client, streamChatThemeData: StreamChatThemeData.fromTheme(theme), child: child, ), home: ChannelListPage(client: client,), ), );
yes, but you told me you're not using the MaterialApp widget, right?
Correct
you need to put the StreamChat widget on top of your custom navigator
This looks like this. so i want to navigate outside the navigator, i don't need the bottom bar and top bar.
ok I'm sorry the snippet is wrong, I just noticed there's a scaffold as top widget.
That said
Yes, but I am not using MaterialApp, because I have my own custom navigation.
You should put the StreamChat widget above the navigator widget you're using
I have tried this but, but user listing screen showing correctly but when i tap on the chat details screen its showing error like this
The following assertion was thrown building _BodyBuilder: You must have a StreamChatTheme widget at the top of your widget tree 'package:stream_chat_flutter/src/stream_chat_theme.dart': Failed assertion: line 25 pos 7: 'streamChatTheme != null'
mmm can you show me where do you put the StreamChat widget? Sorry for the many questions, but I need more info
@imtoori thanks a lot, I have not added StreamChat in chat details at the top. now it's working fine. Thanks.
sounds good even if I would still put it above the navigator widget
======== Exception caught by widgets library ======================================================= The following assertion was thrown building StreamChannelHeader(dirty, dependencies: [_LocalizationsScope-[GlobalKey#275e6], _InheritedTheme]): You must have a StreamChatTheme widget at the top of your widget tree 'package:stream_chat_flutter/src/stream_chat_theme.dart': Failed assertion: line 25 pos 7: 'streamChatTheme != null'