Flutter chat
Dependency Updated
一个聊天助手,用于使用 Firebase 作为后端服务在 Flutter 中创建聊天应用程序。
只是聊天网络演示
如果您觉得这个项目有帮助或者您从源代码中学到了一些东西并想感谢我,请考虑给我买一杯☕️
贝宝
将其添加到包的 pubspec.yaml 文件中:
依赖项:
颤振聊天
在您的 android 和 ios 项目中添加 firebase。
存储安全规则:
规则版本 = '2'; service firebase.storage { match /b/{bucket}/o { match /{allPaths=**} { 允许读、写: if request.auth != null; } } }
Cloud fireStore 的安全规则:
service cloud.firestore { match /databases/{database}/documents { match /{document=**} { 允许读、写:if request.auth != null; } } }
您可以根据需要修改安全规则。
在 firebase 上部署“云功能”。 (在cloudFunction文件夹中提供,用于显示用户在线/离线状态)。
创建一个 Stateful widget 类并调用 body 中的方法(示例可以在 Github 存储库中找到),
在 initState() 中:
-> ChatData.init("应用程序名称",上下文);
并在 Widget 构建的主体中:
-> ChatData.widgetWelcomeScreen(上下文)
享受扑腾的乐趣