firestore_chat 0.1.2 firestore_chat: ^0.1.2 copied to clipboard
Chat using firestore. A very simple complete Chat System for flutter with firestore as backend for chat data. Fully functional package for Cloud Firestore that makes easier to implement chat in your a [...]
Firestore Chatπ₯π¬ #
βοΈ Getting started #
To get started with Firebase, please see the documentation available at https://firebase.flutter.dev/docs/overview
Add Firestore Chat to your project by following the instructions on the install page and start using it:
import 'package:firestore_chat/firestore_chat.dart';
You can open chat page either via Material route or directly push the chat page
await openChatPage(BuildContext context, ChatEntity chatEntity);
or
FirestoreChat().chatPageWidget(chatEntity)
π± Example #
Opening chat #
final chatEntity = ChatEntity(
onMessageSent: (message, chatEntity){
//
},
mainUser: mainUser,
peers: peers,
path: chatPath,
title: "FIFA 2022 Games",
);
//WAY 1
Navigator.push(
context,
FirestoreChat().chatPageWidget(chatEntity),
);
//WAY 2
await openChatPage(context, chatEntity);
...
Models π¦ #
Peer User π¨
Fields
id
- user Idimage
- user image urlname
- user display name
Chat Entity π© #
Fields
mainUser
- logged in userpeers
- Map of users<user ID, PeerUser>
title
- name of the chat (You can name group chats, can benullable
)path
- where the messages/chat should be store on firestoreonMessageSent
- callback for when the message is saved to firestore
License βοΈ #
Issues and feedback π #
If you have any suggestion for including a feature or if something doesn't work, feel free to open a Github issue for us to have a discussion on it.