The following PortalNotFoundError was thrown building _PortalTargetVisibilityBuilder(visible: false, closeDuration: null, builder: Closure: (BuildContext, bool) => Widget, dirty, state: _PortalTargetVisibilityBuilderState#6a473):
Error: Could not find a Portal above this PortalTarget(debugName: null, portalCandidateLabels=[PortalLabel.main]).
The relevant error-causing widget was:
StreamMessageInput StreamMessageInput:file:///home/john/dev/WorkWith/lib/src/features/chat/presentation/channel_page/channel_page.dart:27:17
When the exception was thrown, this was the stack:
#0 _PortalTargetState.build.<anonymous closure> (package:flutter_portal/src/portal_target.dart:265:11)
portal_target.dart:265
#1 _PortalTargetVisibilityBuilderState.build (package:flutter_portal/src/portal_target.dart:449:26)
portal_target.dart:449
#2 StatefulElement.build (package:flutter/src/widgets/framework.dart:5599:27)
framework.dart:5599
Ok I feel stupid, I fixed this by wrapping my chat page in gorouter with StreamChat and also the same with the ChannelListPage in chat_tab.dat, and removed the StreamChat from the home route in gorouter
Which packages are you using?
stream_chat_flutter
On what platforms did you experience the issue?
Android
What version are you using?
7.1.0 (flutter 3.22.0)
What happened?
Steps to reproduce
Here is my code (this code is exactly the same as the code in https://github.com/GetStream/stream-chat-flutter/issues/1923 but with the app_bar removed from channel_page.dart and StreamMessageInput added):
gorouter:
chat_tab.dart (as a tab in BottomNavigationBar):
channel_list.dart:
channel_page.dart:
Also in
main.dart
I wrap theMaterialApp.router
withStreamChatTheme
(following the last comment here: https://github.com/GetStream/stream-chat-flutter/issues/1892)Supporting info to reproduce
Removing StreamMessageInput stops the error from occurring
Relevant log output
No response
Flutter analyze output
Flutter doctor output
Code of Conduct