搜索插件、代码仓与 APP 分类

firebase_chat 封面
插件详情v0.0.6+1

firebase_chat

功能完整的 Cloud Firestore 包,可帮助您更轻松地在应用程序中实现聊天功能

近 30 天下载
16
喜欢数
32
Pub 分数
50

安装插件

flutter pub add firebase_chat

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个功能完整的 Flutter 包,可简化使用 Cloud Firestore 实现聊天功能。它提供即用型组件和实用工具,以最少的设置即可管理实时消息传递、消息持久化和用户在线状态。专为与 Firebase 无缝集成而设计,可处理常见的聊天模式,如发送和接收消息、输入指示器以及已读回执。非常适合希望快速为应用添加强大聊天功能而无需编写样板代码的开发者。

适合场景

  • 实时消息应用
  • 客户支持聊天界面
  • 团队协作工具
  • 应用内消息系统
  • 社交网络应用

主要特点

  • 预构建的聊天 UI 组件
  • 实时消息同步
  • 输入指示器和已读回执
  • 使用 Cloud Firestore 的消息持久化
  • 与 Firebase 身份验证轻松集成

适合对象

  • 开发聊天功能应用的开发者
  • 需要快速聊天实现的初创企业
  • 需要实时通信的应用程序
  • 基于 Firebase 的项目
  • 原型设计聊天功能

使用建议

  • 需要 Firebase Cloud Firestore 设置
  • 在不修改源代码的情况下,自定义功能有限
  • 依赖 Firebase 身份验证
  • 未针对大规模群聊进行优化
  • 无内置媒体上传支持

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Firebase Chat🔥💬

⛏️ Getting started

To get started with Firebase, please see the documentation available at https://firebase.flutter.dev/docs/overview

Add Firebase Chat to your project by following the instructions on the install page and start using it:

import 'package:firebase_chat/firebase_chat.dart';

📱 Example

Extend your StatefulWidget
class ChatPage extends BaseChat {
  ChatPage({
    @required ChatEntity entity,
  }) : super(entity);

  @override
  _ChatPageState createState() => _ChatPageState();
}

class _ChatPageState extends BaseChatState<ChatPage> {
...
Override Methods and Properties

You can checkout example file

Widget inputBuilder(BuildContext context, ChatInputState state);
Future editAndUpload(Uint8List data);
Future getImage();

Widget get emptyWidget;
Widget get errorWidget;
Widget get loadingWidget;
Color  get primaryColor;
Color  get secondaryColor;

Models 📦

Peer User 👨
Fields
  • id - user Id
  • image - user image url
  • name - user display name
Constructors
  • PeerUser({this.id, this.image, this.name})
  • PeerUser.fromSnapshot(DocumentSnapshot snap)
Chat Entity 📩
Fields
  • mainUser - logged in user
  • peers - Map of users <user ID, PeerUser>
  • lastMessage - last sent message
  • title - name of the chat (You can name group chats, can be nullable)

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.

所属分类

依赖

依赖清单 10 项

源码仓库

使用此插件的项目

暂无相关数据。