use notification.message_new event

This commit is contained in:
Salvatore Giordano
2021-08-30 10:21:40 +02:00
parent c840abc29e
commit eeb6b2a6d0
+6 -1
View File
@@ -13,7 +13,12 @@ class MyObserver extends NavigatorObserver {
late final StreamSubscription _subscription;
MyObserver(StreamChatClient client, BuildContext context) {
_subscription = client.on(EventType.messageNew).listen((event) {
_subscription = client
.on(
EventType.messageNew,
EventType.notificationMessageNew,
)
.listen((event) {
final channelId = event.channelId;
if (currentRoute?.settings.name == Routes.CHANNEL_PAGE) {
final args = currentRoute?.settings.arguments as ChannelPageArgs;