A modern, real-time chat application built with Flutter and Firebase that provides seamless messaging experience with user authentication, media sharing, and live chat functionality.
- β User Authentication (Login/Register)
- β Real-time Messaging
- β Image Sharing
- β User Profile Management
- β Online Status Tracking
- β Chat History
- β Responsive UI Design
- β Dark/Light Theme Support
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β View βββββΊβ ViewModel βββββΊβ Model β
β (Pages/UI) β β (Providers) β β (Services/Data) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
lib/
βββ π main.dart # Application entry point
βββ π firebase_options.dart # Firebase configuration
β
βββ π models/ # Data Models
β βββ π€ chat_user.dart # User data model
β βββ π¬ chat_message.dart # Message data model
β βββ π£οΈ chat.dart # Chat conversation model
β
βββ π pages/ # UI Screens
β βββ π splash_page.dart # App loading screen
β βββ π login_page.dart # User login interface
β βββ βοΈ register_page.dart # User registration interface
β βββ π‘ home_page.dart # Main navigation hub
β βββ π¬ chats_page.dart # Chat conversations list
β βββ π¨οΈ chat_page.dart # Individual chat interface
β βββ π₯ users_page.dart # Available users list
β
βββ π providers/ # State Management (MVVM)
β βββ π authentication_provider.dart # Auth state management
β βββ π¬ chats_page_provider.dart # Chats list state
β βββ π¨οΈ chat_page_provider.dart # Individual chat state
β βββ π₯ users_page_provider.dart # Users list state
β
βββ π services/ # Business Logic & APIs
β βββ ποΈ database_service.dart # Firestore operations
β βββ βοΈ cloud_storage_service.dart # Firebase Storage
β βββ π± media_service.dart # Image/Media handling
β βββ π§ navigation_service.dart # Route management
β
βββ π widgets/ # Reusable UI Components
β βββ π custom_input_fields.dart # Input components
β βββ π custom_list_view_tiles.dart # List item components
β βββ π message_bubbles.dart # Chat message UI
β βββ π rounded_button.dart # Button components
β βββ πΌοΈ rounded_image.dart # Image components
β βββ π top_bar.dart # App bar component
β
βββ π utils/ # Helper Functions
βββ π firebase_api_health_check.dart # API status checker
- Provider:
AuthenticationProvider - Features: Login, Registration, Session Management
- Backend: Firebase Authentication
- Provider:
ChatPageProvider - Features: Real-time messaging, Message history
- Backend: Cloud Firestore
- Provider:
UsersPageProvider - Features: User discovery, Profile management
- Backend: Firestore + Firebase Storage
- Service:
MediaService - Features: Image picking, Upload/Download
- Backend: Firebase Cloud Storage
graph TD
A[π App Launch] --> B[π Splash Screen]
B --> C{π User Authenticated?}
C -->|No| D[π Login Page]
C -->|Yes| E[π‘ Home Page]
D --> F[π Firebase Auth]
D --> G[βοΈ Register Page]
G --> F
F -->|Success| H[π€ Create User Profile]
F -->|Failure| I[β Show Error]
I --> D
H --> J[πΎ Store in Firestore]
J --> E
E --> K[π± Bottom Navigation]
K --> L[π¬ Chats Tab]
K --> M[π₯ Users Tab]
L --> N[π Load Chat List]
N --> O[βοΈ Firestore Query]
O --> P[π Display Chats]
P --> Q{π± Chat Selected?}
Q -->|Yes| R[π¨οΈ Open Chat Page]
M --> S[π₯ Load Users List]
S --> T[βοΈ Firestore Query]
T --> U[π Display Users]
U --> V{π€ User Selected?}
V -->|Yes| W[π Create/Open Chat]
W --> R
R --> X[π Real-time Chat Interface]
X --> Y[π Type Message]
X --> Z[π· Send Image]
Y --> AA[πΎ Send to Firestore]
Z --> BB[βοΈ Upload to Storage]
BB --> CC[π Get Download URL]
CC --> AA
AA --> DD[π‘ Real-time Update]
DD --> EE[π± Update UI]
EE --> X
style A fill:#e1f5fe
style E fill:#e8f5e8
style R fill:#fff3e0
style F fill:#fce4ec
User Input β Validation β Firebase Auth β User Profile Creation β Database Storage β Navigation
Select User β Check Existing Chat β Create New/Open Existing β Real-time Listener β UI Update
Compose Message β Validate Content β Upload Media (if any) β Store in Firestore β Real-time Broadcast
Firestore Listener β Data Parsing β UI State Update β Message Display β Read Status Update
- Flutter - Cross-platform UI framework
- Dart - Programming language
- Provider - State management
- Material Design - UI/UX framework
- Firebase Authentication - User management
- Cloud Firestore - Real-time database
- Firebase Storage - Media file storage
- Firebase Analytics - User analytics
get_it- Dependency injectionfile_picker- Media file selectionflutter_spinkit- Loading animationstimeago- Relative time formattingflutter_keyboard_visibility- Keyboard detection
- App initialization
- Firebase configuration
- Authentication state check
- Route to appropriate screen
- Login: Email/password validation, Firebase auth
- Register: User data collection, profile creation
- Error handling: Input validation, network errors
- Bottom navigation setup
- Tab management (Chats, Users)
- Real-time data synchronization
- User status updates
- Chat conversations list
- Last message preview
- Unread message indicators
- Pull-to-refresh functionality
- Available users discovery
- User search functionality
- Online status indicators
- Chat initiation
- Real-time messaging interface
- Message type handling (text/image)
- Media upload/download
- Message status indicators
- Keyboard management
- Flutter SDK (>=2.12.0)
- Firebase project setup
- Android Studio / VS Code
- Clone the repository
git clone <repository-url>
cd Chatify - Flutter Firebase Chat Application- Install dependencies
flutter pub get- Firebase Setup
- Create Firebase project
- Add Android/iOS apps
- Download config files:
google-services.jsonβandroid/app/GoogleService-Info.plistβios/Runner/
- Enable Firebase services
- Authentication (Email/Password)
- Cloud Firestore
- Firebase Storage
- Run the application
flutter runflutter runflutter build apk --release
flutter build ios --releaseflutter install- Authentication: Secure Firebase Auth
- Data Validation: Input sanitization
- Privacy: User data protection
- Storage Rules: Firestore security rules
- Lazy Loading: Efficient data fetching
- Image Caching: Optimized media loading
- Real-time Updates: Efficient listeners
- Memory Management: Proper disposal
- Responsive Design: Adaptive layouts
- Theme Support: Light/dark modes
- Animations: Smooth transitions
- Accessibility: Screen reader support
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Nitish - Flutter Developer
- Flutter team for the amazing framework
- Firebase for backend services
- Material Design for UI guidelines
- Open source community for packages
Built with β€οΈ using Flutter & Firebase