Skip to content

asmitjain71/CareGiverApp

Repository files navigation

Project Report: Caregiver App - Flutter Caregiver-Patient Application

Project Name: Caregiver App
Developer: Asmit Jain
Guidance: Dr. Avinash Gautam
Technology Stack: Flutter (Dart), Firebase
Project Type: Healthcare Mobile Application
Date: 29-11-25


Table of Contents

  1. Executive Summary
  2. Project Overview
  3. Architecture & Technology Stack
  4. System Architecture
  5. Features & Functionality
  6. Database Structure
  7. User Roles & Workflows
  8. Code Organization & Structure
  9. Dependencies & Libraries
  10. User Interface Design
  11. Future Improvements
  12. Conclusion

Executive Summary

CareGiver App is a comprehensive mobile healthcare application developed using Flutter framework that facilitates seamless communication and coordination between caregivers and patients. The application serves as a digital healthcare platform offering features including appointment booking, real-time messaging, medication management, inventory tracking, and caregiver request systems. The project leverages Firebase as its backend infrastructure, providing real-time data synchronization, authentication, and cloud storage capabilities.

Key Highlights:

  • Dual-role application supporting both Caregiver and Patient interfaces
  • Real-time messaging and appointment management
  • Comprehensive medication scheduling with notification system
  • Inventory management with low-stock alerts
  • Location-based caregiver discovery
  • Modern Material Design 3 UI implementation

Project Overview

Purpose -

The application addresses the need for a centralized healthcare management system that:

  • Enables patients to find and book appointments with caregivers
  • Facilitates caregiver-patient communication through real-time chat
  • Manages medication schedules with automated reminders
  • Tracks medical inventory for healthcare facilities
  • Allows patients to request caregiver assistance

Target Users

  1. Patients: Individuals seeking medical consultation and managing their healthcare needs
  2. Caregivers: Healthcare providers managing appointments, patient records, and medication schedules

Core Value Proposition

The application streamlines healthcare interactions by providing:

  • Instant caregiver discovery and appointment booking
  • Real-time communication channels
  • Automated medication reminders
  • Efficient inventory management
  • Location-based healthcare provider search

Architecture & Technology Stack

Frontend Framework

Flutter 3.4.3+

  • Cross-platform mobile development framework
  • Single codebase for Android and iOS
  • Material Design 3 implementation
  • Hot reload for rapid development

Dart Language

  • Strongly typed, object-oriented programming language
  • Null safety enabled
  • Modern async/await patterns

Backend Services

Firebase Ecosystem:

  1. Firebase Authentication (firebase_auth: ^6.1.1)

    • Email/password authentication
    • User session management
    • Role-based access control
  2. Firebase Realtime Database (firebase_database: ^12.0.3)

    • NoSQL real-time database
    • Event-driven data synchronization
    • JSON tree structure
  3. Firebase Storage (firebase_storage: ^13.0.3)

    • Profile image storage
    • Scalable cloud file storage
  4. Firebase Cloud Firestore (cloud_firestore: ^6.0.3)

    • Secondary database option (configured but primarily uses Realtime Database)
  5. Firebase Cloud Messaging (firebase_messaging: ^16.0.3)

    • Push notifications infrastructure
    • Background message handling

Additional Libraries

Core Dependencies:

  • google_fonts: ^6.2.1 - Custom typography (Plus Jakarta Sans, Poppins)
  • intl: ^0.19.0 - Internationalization and date formatting
  • location: ^8.0.0 - GPS location services
  • google_maps_flutter: ^2.6.1 - Interactive maps integration
  • image_picker: ^1.1.2 - Gallery/camera image selection
  • url_launcher: ^6.3.0 - External URL and phone dialer integration
  • file_picker: ^8.1.2 - File system access for imports
  • syncfusion_flutter_pdf: ^25.1.35 - PDF parsing for inventory imports

Notification System:

  • flutter_local_notifications: ^19.5.0 - Local device notifications
  • timezone: ^0.10.1 - Timezone-aware scheduling

System Architecture

Application Architecture Pattern

Pattern: Stateful Widget-based with Firebase Stream Integration

Key Components:

  1. Authentication Layer

    • Firebase Auth for user authentication
    • Role-based routing (Caregiver vs Patient)
    • Session persistence
  2. Data Layer

    • Firebase Realtime Database listeners
    • Stream-based reactive UI updates
    • Local state management using StatefulWidget
  3. Presentation Layer

    • Widget tree composition
    • Material Design 3 components
    • Custom reusable widgets
  4. Service Layer

    • NotificationService (Singleton pattern)
    • Centralized notification management
    • Timezone-aware scheduling

Data Flow

User Interaction → Widget Event Handler → Firebase Database Operation
                                              ↓
                                         Stream Listener
                                              ↓
                                         State Update
                                              ↓
                                         UI Rebuild

Features & Functionality

1. Authentication System

Login Page (lib/auth/login_page.dart)

  • Email and password authentication
  • Form validation
  • Password visibility toggle
  • Error handling with user-friendly dialogs
  • Automatic role detection (Caregiver/Patient)
  • Navigation to appropriate home screen

Registration Page (lib/auth/signup_screen.dart)

  • Dual-role registration (Caregiver/Patient)
  • Comprehensive form with validation:
    • Email, password, phone number
    • First name, last name
    • City selection (Delhi, Uttar Pradesh, Guwahati, Tezpur)
    • Profile image upload
    • Location capture (latitude/longitude)
  • Caregiver-specific fields:
    • Qualification
    • Category (Dentist, Cardiology, Oncology, Surgeon)
    • Years of experience
  • Profile image storage in Firebase Storage
  • Automatic user profile creation in Firebase Database

Splash Screen (lib/splash_screen.dart)

  • Elegant branded loading screen
  • Automatic authentication check
  • Role-based navigation
  • 2-second delay for branding visibility

2. Patient Features

Patient Home Page (lib/patient/patient_home_page.dart)

Bottom navigation with 4 tabs:

  1. Home (Caregiver List)
  2. Requests (Caregiver Requests)
  3. Chat
  4. Profile

Caregiver Discovery & Booking

  • Browse available caregivers by category
  • View caregiver profiles with:
    • Profile image
    • Name and category
    • City location
    • Rating information
  • Caregiver detail page features:
    • Full profile information
    • Phone call integration
    • Chat initiation
    • Google Maps location view
    • Appointment booking form:
      • Date picker
      • Time picker
      • Description field
    • Real-time appointment submission

Caregiver Request System (lib/patient/caregiver_request_page.dart)

  • Patient profile selection
  • Quick request buttons:
    • Water refill
    • Next medication
    • Assistance to restroom
    • Pain relief
    • Vitals check
  • Custom request messaging
  • Medication-linked requests (from medication schedule)
  • Request status tracking:
    • Pending
    • In-progress
    • Resolved
  • Real-time request history

Chat Functionality (lib/patient/chat_list_page.dart)

  • List of previous conversations
  • Direct messaging with caregivers
  • Real-time message synchronization

3. Caregiver Features

Caregiver Home Page (lib/doctor/doctor_home_page.dart)

Bottom navigation with 6 tabs:

  1. Home (Requests)
  2. Patients
  3. Medication
  4. Chat
  5. Profile
  6. Inventory

Appointment Management (lib/doctor/doctor_requests_page.dart)

  • Tabbed interface:
    • Appointments Tab: View appointment requests from patients
      • See appointment details (date, time, description)
      • Status management (Accepted, Rejected, Completed)
      • Real-time updates
    • Patient Requests Tab: Manage caregiver requests
      • View patient requests with status
      • Update request status (pending → in-progress → resolved)
      • See linked medications
      • Timestamp tracking

Patient Profile Management (lib/patient_profile_management_page.dart)

  • Create patient profiles
  • Add patient information:
    • Name, age, date of birth
    • Phone number
    • Medical history
    • Medication needs
  • Edit existing patient records
  • Delete patient profiles
  • Real-time patient list display

Medication Scheduling (lib/medication_schedule_page.dart)

  • Patient selection dropdown
  • Add medication schedules:
    • Medication name
    • Dosage information
    • Frequency
    • Time of day
  • Conflict detection (prevents duplicate times)
  • Edit existing schedules
  • Automatic daily notification scheduling
  • Visual schedule display with time badges
  • Real-time synchronization

Inventory Management (lib/inventory_management_page.dart)

  • Core Features:

    • Add medications manually
    • Import from JSON/PDF files
    • Real-time inventory tracking
    • Low stock alerts (< 10 units)
    • Expiry date tracking
    • Stock reconciliation
    • Reorder generation
  • Import Capabilities:

    • JSON file parsing with flexible field mapping
    • PDF text extraction using Syncfusion PDF library
    • Automatic data normalization
  • Visual Indicators:

    • Color-coded status badges (Low stock, Expiring soon, Healthy)
    • Quantity and expiry date display
    • Search functionality (by name or description)
  • Operations:

    • Edit medication details
    • Reconcile stock quantities
    • Generate reorder requests
    • Delete medications

Chat List (lib/doctor/doctor_chatlist_page.dart)

  • View all patient conversations
  • Navigate to individual chat threads
  • Real-time message updates

4. Real-Time Messaging (lib/chat_screen.dart)

Features:

  • Bidirectional messaging (Caregiver ↔ Patient)
  • Real-time message synchronization using Firebase streams
  • Message timestamps
  • Chat bubble design (sent vs received)
  • Auto-scrolling to latest messages
  • Chat list maintenance for conversation history

Implementation:

  • Firebase Realtime Database structure:
    • /Chat: Stores individual messages
    • /ChatList: Maintains conversation relationships

5. Notification System (lib/services/notification_service.dart)

Capabilities:

  • Local notifications (Android & iOS)
  • Scheduled notifications
  • Daily recurring notifications
  • Timezone-aware scheduling
  • Notification channels (main, scheduled, daily)

Use Cases:

  • Low inventory alerts
  • Medication reminders
  • Request confirmations

6. Profile Management (lib/profile_page.dart)

Unified Profile View:

  • Displays user information based on role
  • Shows profile picture
  • Contact information
  • Role-specific details:
    • Caregivers: Category, Qualification
    • Patients: City, Contact info
  • Appointment history
  • Logout functionality

Database Structure

Firebase Realtime Database Schema

/
├── Doctors/
│   └── {doctorUID}/
│       ├── uid
│       ├── email
│       ├── firstName
│       ├── lastName
│       ├── phoneNumber
│       ├── city
│       ├── latitude
│       ├── longitude
│       ├── profileImageUrl
│       ├── qualification
│       ├── category
│       ├── yearsOfExperience
│       ├── totalReviews
│       ├── averageRating
│       └── numberOfReviews
│
├── Patients/
│   └── {patientUID}/
│       ├── uid
│       ├── email
│       ├── firstName
│       ├── lastName
│       ├── phoneNumber
│       ├── city
│       ├── latitude
│       ├── longitude
│       ├── profileImageUrl
│       ├── age (optional)
│       ├── dob (optional)
│       ├── medicalHistory (optional)
│       └── medicationNeeds (optional)
│
├── Requests/
│   └── {requestId}/
│       ├── id
│       ├── date
│       ├── time
│       ├── description
│       ├── sender (patientUID)
│       ├── receiver (doctorUID)
│       └── status (pending/Accepted/Rejected/Completed)
│
├── CaregiverRequests/
│   └── {patientUID}/
│       └── {requestId}/
│           ├── message
│           ├── status (pending/in-progress/resolved)
│           ├── medication (optional)
│           └── timestamp
│
├── MedicationSchedules/
│   └── {patientUID}/
│       └── {scheduleId}/
│           ├── medication
│           ├── dosage
│           ├── frequency
│           ├── time
│           └── timestamp
│
├── inventory/
│   └── {itemId}/
│       ├── name
│       ├── quantity
│       ├── expiryDate (ISO8601 string)
│       └── description
│
├── Chat/
│   └── {messageId}/
│       ├── message
│       ├── sender (UID)
│       ├── receiver (UID)
│       └── timestamp (ISO8601)
│
└── ChatList/
    └── {userUID}/
        └── {chatPartnerUID}/
            └── id

Data Relationships

  1. Appointments: Patient (sender) → Caregiver (receiver)
  2. Chats: Bidirectional (both users maintain ChatList entry)
  3. Medication Schedules: Patient-specific nested structure
  4. Inventory: Global list accessible to all caregivers
  5. Caregiver Requests: Patient-specific with nested requests

User Roles & Workflows

Patient Workflow

  1. Registration/Login

    Splash Screen → Login/Register → Role Detection → Patient Home
    
  2. Finding a Caregiver

    Home Tab → Browse Caregivers → Select Category → View Details → Book Appointment
    
  3. Booking Appointment

    Caregiver Details → Select Date/Time → Add Description → Submit → Status Tracking
    
  4. Sending Caregiver Request

    Requests Tab → Select Profile → Choose Quick Request OR Custom Message → Submit
    
  5. Medication-Linked Request

    Requests Tab → View Medication Schedule → Select Medication → Add Note → Send Request
    
  6. Chatting with Caregiver

    Chat Tab → Select Conversation → Send/Receive Messages
    

Caregiver Workflow

  1. Registration/Login

    Splash Screen → Login/Register → Role Detection → Caregiver Home
    
  2. Managing Appointments

    Home Tab → View Requests → Accept/Reject/Complete → Status Update
    
  3. Managing Patient Requests

    Home Tab → Patient Requests Tab → View Requests → Update Status
    
  4. Creating Patient Profiles

    Patients Tab → Add Patient → Fill Form → Save
    
  5. Scheduling Medications

    Medication Tab → Select Patient → Add Schedule → Set Time → Save → Notification Created
    
  6. Inventory Management

    Inventory Tab → Add/Import Medications → Monitor Stock → Reconcile → Reorder
    

Code Organization & Structure

Directory Structure

lib/
├── auth/
│   ├── login_page.dart
│   └── signup_screen.dart
│
├── doctor/
│   ├── doctor_chatlist_page.dart
│   ├── doctor_details_page.dart
│   ├── doctor_home_page.dart
│   ├── doctor_list_page.dart
│   ├── doctor_profile.dart
│   ├── doctor_requests_page.dart
│   ├── model/
│   │   ├── booking.dart
│   │   ├── doctor.dart
│   │   └── patient.dart
│   └── widget/
│       └── doctor_card.dart
│
├── patient/
│   ├── caregiver_request_page.dart
│   ├── chat_list_page.dart
│   └── patient_home_page.dart
│
├── model/
│   └── medication_inventory.dart
│
├── services/
│   └── notification_service.dart
│
├── chat_screen.dart
├── firebase_options.dart
├── inventory_management_page.dart
├── main.dart
├── medication_schedule_page.dart
├── patient_profile_management_page.dart
├── profile_page.dart
└── splash_screen.dart

Code Patterns & Practices

1. State Management:

  • StatefulWidget for local state
  • StreamBuilder for real-time data
  • setState() for UI updates

2. Service Pattern:

  • Singleton NotificationService
  • Centralized notification management

3. Model Classes:

  • Factory constructors for Firebase data mapping
  • toMap() methods for serialization
  • Null-safe data handling

4. Widget Composition:

  • Reusable custom widgets
  • Material Design 3 components
  • Consistent styling via Theme

5. Error Handling:

  • Try-catch blocks for async operations
  • User-friendly error messages
  • Loading states for async operations

Dependencies & Libraries

Production Dependencies

dependencies:
  flutter:
    sdk: flutter
  
  # Firebase Services
  firebase_core: ^4.2.0
  firebase_auth: ^6.1.1
  firebase_database: ^12.0.3
  cloud_firestore: ^6.0.3
  firebase_storage: ^13.0.3
  firebase_messaging: ^16.0.3
  
  # UI & Design
  cupertino_icons: ^1.0.6
  google_fonts: ^6.2.1
  
  # Utilities
  intl: ^0.19.0
  location: ^8.0.0
  url_launcher: ^6.3.0
  image_picker: ^1.1.2
  file_picker: ^8.1.2
  
  # Features
  google_maps_flutter: ^2.6.1
  flutter_local_notifications: ^19.5.0
  syncfusion_flutter_pdf: ^25.1.35
  timezone: ^0.10.1

Development Dependencies

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^6.0.0

Dependency Analysis

Total Dependencies: 18 production, 2 development

Key Dependency Purposes:

  • Firebase Suite: Complete backend infrastructure
  • Google Fonts: Brand consistency and typography
  • Location Services: GPS-based caregiver discovery
  • File Handling: Inventory import capabilities
  • Notifications: Medication reminders and alerts
  • Maps Integration: Location visualization

User Interface Design

Design System

Theme Configuration (lib/main.dart):

  • Primary Color: Royal Blue (#2563EB)
  • Secondary Color: Emerald Green (#10B981)
  • Background: Slate 50 (#F8FAFC)
  • Surface: White
  • Error Color: Red 500 (#EF4444)

Typography:

  • Font Family: Plus Jakarta Sans (via Google Fonts)
  • Brand Font: Poppins (for specific UI elements)
  • Hierarchical text styles

Material Design 3:

  • Elevated buttons with rounded corners (12px radius)
  • Cards with subtle borders and elevation
  • Input fields with filled background
  • Consistent spacing (8px, 16px, 24px, 32px)

Key UI Components

  1. Splash Screen

    • Gradient background (Dark to Blue)
    • Centered logo/image
    • App branding text
    • Loading indicator
  2. Authentication Screens

    • Clean form layouts
    • Custom input fields with blue borders
    • Password visibility toggle
    • Role selection chips
  3. Home Screens

    • Bottom navigation bars
    • Card-based content display
    • Search functionality
    • Category filters
  4. Lists & Cards

    • Caregiver cards with profile images
    • Medication cards with status badges
    • Appointment cards with status indicators
    • Request cards with color-coded status
  5. Forms & Dialogs

    • Modal dialogs for actions
    • Date/time pickers
    • Dropdown selectors
    • Multi-line text inputs

Future Improvements

Short-term Enhancements (1-3 months)

  1. Robotic Integration:

    • Implement a Robotic arm
    • Data would be tranferred and sync across
    • Control from the app
  2. Database Security:

    • Implement comprehensive Firebase security rules
    • Add server-side validation
    • Implement data access controls
  3. Error Handling:

    • Comprehensive error handling
    • User-friendly error messages
    • Retry mechanisms
    • Offline mode support
  4. Testing:

    • Increase unit test coverage to 70%+
    • Add widget tests for key components
    • Implement integration tests
  5. Performance:

    • Implement pagination for lists
    • Add image caching
    • Optimize database queries
    • Lazy loading for large datasets

Medium-term Enhancements (3-6 months)

  1. Advanced Features:

    • Video consultation integration
    • File sharing in chat
    • Prescription generation and printing
    • Appointment reminders via notifications
    • Rating and review system
  2. Analytics:

    • Firebase Analytics integration
    • User behavior tracking
    • Performance monitoring
    • Crash reporting (Firebase Crashlytics)
  3. Payment Integration:

    • Stripe/PayPal integration
    • Appointment payment
    • Transaction history
  4. Enhanced Notifications:

    • Push notifications for appointments
    • Medication reminder improvements
    • Request status notifications

Long-term Enhancements (6+ months)

  1. Compliance:

    • HIPAA compliance implementation
    • GDPR compliance (if international)
    • Medical data encryption
    • Audit logging
  2. Advanced Healthcare Features:

    • Electronic Health Records (EHR)
    • Lab report integration
    • Medical imaging support
    • Telemedicine capabilities
  3. AI Integration:

    • Symptom checker
    • Appointment recommendations
    • Medication interaction warnings
    • Health insights
  4. Multi-platform:

    • Web application version
    • Desktop application
    • Admin dashboard
  5. Internationalization:

    • Multi-language support
    • Regional customization
    • Currency support

Conclusion

The Caregiver App application represents a comprehensive healthcare management solution built with modern mobile development technologies. The project successfully implements core features including appointment booking, real-time messaging, medication management, and inventory tracking. The use of Flutter ensures cross-platform compatibility, while Firebase provides a robust and scalable backend infrastructure.

Key Achievements

Functional Application: All core features are implemented and functional
Modern UI/UX: Material Design 3 implementation with consistent theming
Real-time Synchronization: Firebase Realtime Database enables live updates
Role-based System: Separate interfaces for Caregivers and Patients
Notification System: Automated reminders and alerts
Comprehensive Features: Multiple healthcare management modules

Project Strengths

  1. Well-structured codebase with logical organization
  2. Modern technology stack using industry-standard tools
  3. Real-time capabilities for improved user experience
  4. Scalable architecture with Firebase backend
  5. Feature-rich application covering multiple use cases

Final Assessment

This project demonstrates strong software development skills, understanding of mobile application architecture, and practical implementation of healthcare technology solutions. With the recommended improvements, the application has the potential to serve as a production-ready healthcare management platform.

The codebase is well-organized, functional, and demonstrates understanding of:

  • Mobile application development
  • Backend integration
  • Real-time systems
  • User experience design
  • Database management

Appendix

File Statistics

  • Total Dart Files: ~26
  • Lines of Code: ~5,000+ (estimated)
  • Models: 4 classes
  • Screens: 20+ pages
  • Services: 1 singleton service

Firebase Project Configuration

Development Environment

  • Flutter SDK: 3.4.3+
  • Dart SDK: 3.4.3+
  • Target Platforms: Android, iOS

About

Project under Dr. Avinash Gautam

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages