ChatBox is a cross-platform Flutter chat application that provides real-time messaging, call history, and modern authentication on top of Firebase services. It follows a feature-first architecture with BLoC/Cubit for state management and a repository layer over Firestore and other backend services.
ChatBox is built as a scalable messaging experience where users can sign up, log in, recover passwords, search for other users by email, and exchange rich chat messages (text, media, voice). It also includes call history tracking and a profile area with editable settings and avatars.
Framework
- Flutter (multi-platform app: mobile & desktop)
Navigation & UI
go_routerfor declarative navigation and deep-link friendly routesflutter_screenutilfor responsive sizing and layout
State Management & DI
flutter_bloc/blocfor Cubit/BLoC state management (e.g.,LoginCubit,HomeCubit,CallHistoryCubit,ProfileCubit)get_itas a service locator (used insetupGetIt)
Backend & Data
firebase_core,firebase_auth,cloud_firestorefor authentication and real-time datasupabase_flutteras a storage backend implementation for profile images and other mediadartzfor functionalEitherand error handling in repositories
Media & Platform
image_pickerfor profile image and avatar selection- Various platform-specific plugins for audio, file selection, and secure storage
The app follows a feature-first, layered architecture:
- Presentation layer: Flutter screens and widgets in
features/*/presentation, driven by Cubits likeLoginCubit,HomeCubit,CallHistoryCubit, andProfileCubit. - Domain / Data access layer: Repositories (
AuthRepo,ChatRepo,CallRepo,UserRepo,ProfileRepo,SearchUserRepo) define contracts and delegate to service classes to access Firestore, Firebase Auth, and storage, returningEither<Failure, T>. - Core services: Firestore services (
FirestoreChatService,FirestoreUserService,FirestoreCallService,FirestoreProfileService) encapsulate low-level operations. - Storage:
SupabaseStorageServiceimplementsStorageServiceand handles file uploads (avatars, attachments). - Routing & Composition:
AppRouterdefines GoRoutes and wires Cubits and repos viaBlocProvider/MultiBlocProvider.
Authentication & Onboarding
- Email/password signup and login with validation mixins and custom form components.
- Social login entry points (Google and Facebook) via
FirebaseAuthService. - Password recovery flow with reset email, validation, and success/error dialogs.
User Profiles
- Profile details, picture, and settings managed through
ProfileCubitandProfileState. - Profile picture selection using camera/gallery and upload via
ProfileImageService. - Profile editing dialogs for name, phone, about, privacy, and account actions.
- Dark mode toggle.
- Profile logout flows.
Real-Time Chat
MessageModelsupports statuses (pending, sent, delivered, read, failed) and multiple types (text, voice, image, file).- Firestore-backed one-to-one chat rooms with unread counts and server timestamps.
- Chat cubit handles sending text, voice messages, attachments with optimistic updates.
Home & Search
- Home chat list driven by
HomeCubit, with batched user profile fetching viaUserRepo. - Search users by email with
SearchUserCubit.
Calls & History
ZegoServicehandles ZegoCloud initialization.CallEventsHandlertracks call events and syncs with Firestore.CallModelrepresents calls with types, status and timestamps.FirestoreCallServicemanages call creation, updates, streams and cleanup.
Notifications
MessagingConfigsetups FCMNotificationServicehandles foreground notifications, channels, and routing from payloads.
Navigation
- Centralized
AppRouterwires all screens (splash, onboarding, login, signup, choose picture, recover password, home, chat, calls, profile, navigation bar) and injects dependencies usinggetIt.
Repository includes standard Flutter test scaffolding. Suggested targets:
- Cubit/BLoC unit tests (
LoginCubit,HomeCubit, etc.) - Widget tests for core views (login, onboarding, home, chat list, call history, profile)
Add tests under /test using flutter_test and BLoC testing patterns.
lib/
core/
cubit/
errors/
helpers/
repos/
service/
utils/
widgets/
features/
auth/
data/
presentation/
onboarding/
presentation/
home/
data/
presentation/
chat/
data/
presentation/
calling/
data/
presentation/
profile/
data/
presentation/
navigation_bar/
presentation/
splash/
presentation/
main.dart
android/ ios/ macos/ linux/ windows/ web/
- Install Flutter (stable channel compatible with the project).
- Install IDE (Android Studio or VS Code) with Flutter & Dart plugins.
- Create a Firebase project (Firestore + Authentication).
git clone https://github.com/EsAm1973/ChatBox-App.git
cd ChatBox-App
flutter pub get-
Enable Email/password authentication and Cloud Firestore.
-
Add platform configuration files:
- Android:
android/app/google-services.json - iOS:
ios/Runner/GoogleService-Info.plist - Web/Desktop: configure
DefaultFirebaseOptionsinfirebase_options.dart.
- Android:
-
Ensure bundle IDs/application IDs match Firebase config.
flutter run
# or target a specific device
flutter run -d chromeHere are some screenshots showcasing the UI of ChatBox:
- LinkedIn: (Mohamed Esam)
Contributions, issues, and feature requests are welcome—open a discussion or pull request.


















