Skip to content

gopal5587/Flutter-Chat-Application

Repository files navigation

💬 Flutter Chat Application

A real-time cross-platform chat app built with Flutter and Firebase. Features secure authentication, live messaging, image sharing, push notifications, and Cloud Storage — all wrapped in a clean, responsive Material UI.


📱 Features

  • User Authentication — Secure sign-up and login via Firebase Auth (Email/Password)
  • Real-Time Messaging — Instant message delivery powered by Cloud Firestore
  • Image Sharing — Pick and send images from device gallery using image_picker + Firebase Storage
  • Push Notifications — Background and foreground notifications via Firebase Cloud Messaging (FCM)
  • Cloud Functions — Server-side logic with Firebase Functions (in /functions)
  • User Profiles — Custom display name and avatar management
  • Chat Rooms — Clean conversation list with real-time updates
  • Fully Responsive — Smooth UI across Android and iOS

🛠️ Tech Stack

Technology Purpose
Flutter UI Framework
Dart Programming Language
Firebase Auth User Authentication
Cloud Firestore Real-Time Database
Firebase Storage Image & Media Uploads
Firebase Messaging Push Notifications
Firebase Functions Server-Side Logic
image_picker Device Gallery Access

📂 Project Structure

Flutter-Chat-Application/
├── android/                  # Android platform files
├── ios/                      # iOS platform files
├── linux/                    # Linux desktop support
├── macos/                    # macOS desktop support
├── web/                      # Web support
├── windows/                  # Windows desktop support
├── assets/
│   └── images/
│       └── chat.png          # App logo / splash asset
├── functions/                # Firebase Cloud Functions
├── lib/                      # Main Dart source code
│   ├── main.dart             # App entry point
│   ├── models/               # Data models (User, Message)
│   ├── screens/              # UI screens (Auth, Chat, Profile)
│   ├── widgets/              # Reusable UI components
│   └── services/             # Firebase service wrappers
├── test/                     # Unit and widget tests
├── firebase.json             # Firebase project config
├── pubspec.yaml              # Dependencies
└── README.md

🚀 Getting Started

Prerequisites

Make sure you have the following installed:

Installation

  1. Clone the repository

    git clone https://github.com/gopal5587/Flutter-Chat-Application.git
    cd Flutter-Chat-Application
  2. Install Flutter dependencies

    flutter pub get
  3. Configure Firebase

    • Create a project in Firebase Console
    • Add Android and/or iOS apps to the project
    • Download and place the config files:
      • Android → android/app/google-services.json
      • iOS → ios/Runner/GoogleService-Info.plist
    • Enable Email/Password under Authentication → Sign-in method
    • Create a Firestore database (start in test mode)
    • Enable Firebase Storage
    • Enable Firebase Cloud Messaging
  4. Run the app

    flutter run

Deploy Cloud Functions (Optional)

cd functions
npm install
firebase deploy --only functions

Build for Release

# Android APK
flutter build apk --release

# iOS (requires macOS + Xcode)
flutter build ios --release

🖥️ Supported Platforms

Platform Supported
Android
iOS
Web
Windows
macOS
Linux

📦 Dependencies

dependencies:
  firebase_core: ^3.15.2          # Firebase initialization
  firebase_auth: ^5.7.0           # User authentication
  firebase_storage: ^12.4.10      # Image/media uploads
  cloud_firestore: ^5.6.12        # Real-time messaging database
  firebase_messaging: ^15.2.10    # Push notifications
  image_picker: ^1.1.2            # Pick images from gallery/camera
  cupertino_icons: ^1.0.8         # iOS-style icons

🔐 Firebase Security Rules (Recommended)

// Firestore
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /messages/{message} {
      allow read, write: if request.auth != null;
    }
    match /users/{userId} {
      allow read: if request.auth != null;
      allow write: if request.auth.uid == userId;
    }
  }
}

⚠️ Never leave Firestore in test mode for production. Always secure your rules.


🤝 Contributing

Contributions are welcome! To contribute:

  1. Fork the repository
  2. Create a new branch — git checkout -b feature/your-feature
  3. Commit your changes — git commit -m 'Add your feature'
  4. Push to the branch — git push origin feature/your-feature
  5. Open a Pull Request

📄 License

This project is open-source and available under the MIT License.


👤 Author

gopal5587


Built with ❤️ using Flutter & Firebase

About

✨ Flutter Chat Application — A cross‑platform real‑time messaging app built with Flutter, featuring user authentication, one‑to‑one chat, and a clean, responsive UI for Android and iOS.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors