'Flutter Chat App or Messaging App Notification

I am making a chat app with flutter. I used StreamBuilder to receive messages and store them in Firestore.

 StreamBuilder<QuerySnapshot<Map<String, dynamic>>>(
                stream: FirestoreHelper.firestoreHelper
                    .getMessageStream(widget.chatRoomModel.chatRoomId),
                builder: (context, dataSnapshot) {})

I want to include notifications in my app.

What should I use and what should I read. I am a junior flutter developer and I do not have any idea about notification.



Solution 1:[1]

Chat app article on Medium

  1. The app explained there uses: firebase_messaging plugin to register push service and listening notification coming.
  2. Cloud Functions fire a callback when it is triggered by an event — new document is added.
  3. local_notifications to render our local notification when app in the foreground.

If you've found a better way, that's more up to date than the 2019 article, please answer your own question. I'm beginning work on it too.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sam