-1

I'm new to Flutter and want to incorporate a chat functionality in a Flutter mobile application using PubNub. I was able to send messages to PubNub, but I'm struggling to consume the messages sent by other users. I found an example here: Flutter Demo App, but I'm just looking for the way to consume the messages coming in the stream. Any help is appreciated.

aldo_vw
  • 608
  • 6
  • 17
  • I think this is best handled by our support team. Please send the following to support@pubnub.com: your PubNub sub-key, zip your app and attach, reproduce the error with [SDK logging enabled](https://www.pubnub.com/docs/sdks/dart/troubleshooting) and any errors you might be seeing. Support is free, fast and insightful. Include the link to this post so we can answer back when we resolve your issue. – Craig Conover Apr 27 '21 at 17:56

1 Answers1

0

Providers may help you with this! Have a provider for chat messages and update the message list when messages are received in PubNub subscribe (& notify listeners). In this way, you can directly consume received messages in the PubNub's message callback. This is one way doing it!

Craig Conover
  • 4,710
  • 34
  • 59