Flutter 社交聊天
使用 Firebase 和 GetStream 的实时社交聊天应用——开源且功能丰富
- 星标
- 217
- 复刻
- 50
- 最近推送(UTC)
- 2025年5月19日
- 项目状态
- 未归档
原始 README
以下为英文项目原文快照,最新内容请访问 GitHub。
Flutter Social Chat
A modern, feature-rich social chat application built with Flutter following the MVVM architecture. This app combines social networking features with robust real-time messaging capabilities.
🤝 Sponsored by Stream

Flutter Social Chat is proudly sponsored by Stream, the leading provider for chat and activity feed APIs.
This marks another exciting collaboration with Stream after our initial release. The powerful Stream Chat SDK enables us to implement robust, scalable, and feature-rich chat functionality with minimal effort.
📖 Official Blog Coverage
- Building a Flutter Social Chat App: MVVM Architecture & Stream Chat (2025)
- Building a Social Chat App with Flutter and Stream (2023)
The latest blog post dives into our architectural decisions, feature set, and how the Stream Chat SDK powers real-time communication in this modern Flutter app.
🚀 Technical Highlights
- ⚡ MVVM Architecture: Clean separation of UI, business logic, and data
- 🔄 BLoC Pattern: Efficient reactive state management with Flutter BLoC
- 🔌 Stream Chat SDK: Powerful real-time messaging capabilities
- 🔐 Firebase Integration: Authentication and data storage with Firebase
- 📱 Responsive Design: Adaptive UI for different device sizes
- 🧩 Modular Structure: Well-organized codebase with clear separation of concerns
- 🌐 Environment Configuration: Secure management of API keys and secrets
- 🔌 Dependency Injection: Flexible service location with GetIt
- 🧪 Functional Programming: Elegant flow with FPDart
💬 Core Features
- 🔑 Phone Authentication: Secure sign-in with SMS verification
- 💬 Real-time Chat: Instant messaging powered by Stream Chat
- 🔍 User Discovery: Find and connect with other users
- 📊 Chat Management: Create, list, and manage conversations
- 🔔 Connectivity Handling: Graceful online/offline state management
📱 App Showcase
App Flow Demo
Demo Video
Click the image above to watch the full app demo
Screenshots
Authentication Flow
| Landing Page |
Sign In |
SMS Verification |
Onboarding |
Main App Features
| Dashboard |
Search Users |
Chat Options |
Chat Creation
| Create Private Chat |
Create Group Chat |
Chat Experience
| Chat View |
Message Details |
Message Reactions |
Profile View |
🏗️ Architecture
Flutter Social Chat follows the MVVM (Model-View-ViewModel) architecture, with a clean separation of concerns:
lib/
├── core/ # Core functionality, utils, and app-wide services
├── data/ # Data layer with repositories and data sources
├── domain/ # Domain layer with models
├── presentation/ # UI layer with views, blocs, and design system
└── main.dart # Application entry point
State Management
The app uses BLoC (Business Logic Component) pattern for state management:
- Separation of UI and Business Logic: Clear distinction between presentation and business logic
- Testability: Easy unit testing of business logic
- Reactive Programming: Stream-based approach for handling state changes
- Equatable: All state classes use Equatable for efficient state comparison
🔧 How to Run
Setup Steps
- Clone the repository
git clone https://github.com/yourusername/flutter_social_chat.git
cd flutter_social_chat
- Install dependencies
flutter pub get
- Firebase Setup
- Create a new Firebase project at Firebase Console
- Add Android and iOS apps to your Firebase project
- Download and add the
google-services.jsonto the Android app directory - Download and add the
GoogleService-Info.plistto the iOS app directory - Enable Phone Authentication in the Firebase Authentication section
- Set up Firestore Database with appropriate security rules
- Stream Chat Setup
- Create an account on Stream
- Create a new app in the Stream dashboard
- Get your API Key and Secret from the app dashboard
- Create a
.envfile in the project root with your Stream credentials:
STREAM_CHAT_API_KEY=your_stream_chat_api_key
STREAM_CHAT_API_SECRET=your_stream_chat_api_secret
- For detailed environment setup instructions, see ENV_SETUP.md
- Run the app
flutter run
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
分类
使用的依赖
依赖清单 30 项
- flutter
{"sdk":"flutter"} - flutter_localizations
{"sdk":"flutter"} - intl_phone_number_input
^0.7.4 - go_router
^15.0.0 - pin_code_fields
^8.0.1 - bot_toast
^4.1.3 - cupertino_icons
^1.0.8 - cached_network_image
^3.4.1 - date_format
^2.0.9 - path_provider
^2.1.5 - connectivity_plus
^6.1.3 - flutter_bloc
^9.1.0 - hydrated_bloc
^10.0.0 - get_it
^8.0.3 - fpdart
^1.1.1 - uuid
^4.5.1 - equatable
^2.0.7 - google_fonts
^6.2.1 - firebase_core
^3.13.0 - firebase_auth
^5.5.2 - cloud_firestore
^5.6.6 - stream_chat_flutter
^9.8.0 - lottie
^3.3.1 - crypto
^3.0.6 - intl
^0.19.0 - flutter_dotenv
^5.2.1 - flutter_test开发依赖
{"sdk":"flutter"} - build_runner开发依赖
^2.4.15 - flutter_gen_runner开发依赖
^5.10.0 - flutter_lints开发依赖
^5.0.0
所在榜单
如何选择适合项目的代码仓?
先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
- 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
- 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
- 使用前在 GitHub 核对 README、许可证与 Issues。
来源与维护
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗
