Skip to content

SSSD-2001/care-for-elders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ Care for Elders - Healthcare App

A comprehensive Flutter mobile application for managing elderly healthcare needs with Firebase backend integration.

πŸš€ Quick Start

Run the app:

# Android Emulator
flutter run

# Chrome (Web)
flutter run -d chrome

# iOS Simulator
flutter run -d ios

πŸ“š Documentation

πŸ”’ SECURITY NOTICE: Firebase configuration files are NOT included in this repository. You must generate your own configuration files. See FIREBASE_SECURE_SETUP.md for instructions.

πŸ“± Features Implemented

βœ… Authentication System

  • User login and registration
  • Session management with SharedPreferences
  • Splash screen with auto-navigation
  • Profile management

βœ… Dashboard

  • Welcome screen with personalized greeting
  • Quick action cards for common tasks
  • Today's overview with appointments, medications, and health goals
  • Health tips section

βœ… Appointments Management

  • View upcoming and past appointments
  • Appointment details (doctor, date, location, purpose)
  • Quick actions (reschedule, view details)
  • Add new appointments (UI ready)

βœ… Medications Tracking

  • Today's medication schedule
  • Mark medications as taken
  • View all medications with dosage information
  • Refill alerts for low stock
  • Add new medications (UI ready)

βœ… Health Tracking

  • Vital signs monitoring (Blood Pressure, Heart Rate, Blood Sugar, Temperature)
  • Activity logging (Walking, Yoga, etc.)
  • Wellness goals with progress tracking
  • Visual progress indicators

βœ… Emergency Features

  • Large SOS button for emergencies
  • Emergency services (Ambulance, Police, Fire Department) with one-tap calling
  • Emergency contacts list with priority
  • Medical information display (Blood type, Allergies, Medications, Conditions)

βœ… Profile Screen

  • User information display
  • Personal and medical information
  • Settings and preferences
  • Logout functionality

πŸ—οΈ Project Structure

lib/
β”œβ”€β”€ main.dart                      # App entry point
β”œβ”€β”€ constants/
β”‚   └── app_constants.dart         # Colors, styles, constants
β”œβ”€β”€ models/                        # Data models (19 models)
β”‚   β”œβ”€β”€ User.dart
β”‚   β”œβ”€β”€ Appointment.dart
β”‚   β”œβ”€β”€ Medication.dart
β”‚   └── ... (and more)
β”œβ”€β”€ providers/
β”‚   └── auth_provider.dart         # State management for authentication
β”œβ”€β”€ screens/
β”‚   β”œβ”€β”€ auth/                      # Authentication screens
β”‚   β”‚   β”œβ”€β”€ splash_screen.dart
β”‚   β”‚   β”œβ”€β”€ login_screen.dart
β”‚   β”‚   └── register_screen.dart
β”‚   β”œβ”€β”€ home/                      # Main app screens
β”‚   β”‚   β”œβ”€β”€ home_screen.dart       # Bottom navigation
β”‚   β”‚   └── dashboard_tab.dart     # Dashboard
β”‚   β”œβ”€β”€ appointments/
β”‚   β”‚   └── appointments_tab.dart
β”‚   β”œβ”€β”€ medications/
β”‚   β”‚   └── medications_tab.dart
β”‚   β”œβ”€β”€ health_tracking/
β”‚   β”‚   └── health_tracking_tab.dart
β”‚   β”œβ”€β”€ emergency/
β”‚   β”‚   └── emergency_tab.dart
β”‚   └── profile/
β”‚       └── profile_screen.dart
β”œβ”€β”€ services/
β”‚   └── auth_service.dart          # Authentication logic
└── utils/
    └── logger.dart                # Logging utility

πŸš€ Getting Started

Prerequisites

  • Flutter SDK (3.9.0 or higher)
  • Dart SDK
  • Android Studio / Xcode (for iOS)
  • A physical device or emulator

Installation

  1. Clone the repository

    cd /Users/chamindu/Documents/GitHub/care-for-elders
  2. Install dependencies

    flutter pub get
  3. Run the app

    flutter run

Login Credentials (Demo)

For testing, use any email and password with at least 4 characters:

  • Email: test@example.com
  • Password: 1234

πŸ“¦ Dependencies

Core Dependencies

  • provider: ^6.1.1 - State management
  • google_fonts: ^6.1.0 - Custom fonts
  • shared_preferences: ^2.2.2 - Local storage
  • hive: ^2.2.3 - NoSQL database
  • intl: ^0.19.0 - Date formatting

Feature Dependencies

  • flutter_local_notifications: ^17.0.0 - Push notifications
  • url_launcher: ^6.2.2 - Phone calls and URLs
  • permission_handler: ^11.1.0 - App permissions
  • table_calendar: ^3.0.9 - Calendar widget

πŸ”¨ Next Steps for Development

1. Backend Integration

Currently, the app uses dummy data. To make it production-ready:

Option A: Firebase (Recommended for MVP)

# Add Firebase packages
flutter pub add firebase_core firebase_auth cloud_firestore firebase_storage

Then:

  • Set up Firebase project at console.firebase.google.com
  • Configure Firebase for Android/iOS
  • Replace AuthService with Firebase Authentication
  • Store data in Cloud Firestore

Option B: Custom REST API

  • Create services for each feature (AppointmentService, MedicationService, etc.)
  • Implement HTTP calls using http or dio package
  • Handle authentication tokens
  • Implement error handling and retry logic

2. Complete CRUD Operations

Create services for each model:

// Example: lib/services/appointment_service.dart
class AppointmentService {
  Future<List<Appointment>> getAppointments(String userId) async {
    // Implement API call or local database query
  }
  
  Future<bool> createAppointment(Appointment appointment) async {
    // Implement creation logic
  }
  
  Future<bool> updateAppointment(Appointment appointment) async {
    // Implement update logic
  }
  
  Future<bool> deleteAppointment(String appointmentId) async {
    // Implement deletion logic
  }
}

3. Implement Notifications

// lib/services/notification_service.dart
import 'package:flutter_local_notifications/flutter_local_notifications.dart';

class NotificationService {
  final FlutterLocalNotificationsPlugin _notifications = 
      FlutterLocalNotificationsPlugin();
  
  Future<void> initialize() async {
    // Initialize notification settings
  }
  
  Future<void> scheduleMedicationReminder(
    Medication medication,
    DateTime scheduledTime,
  ) async {
    // Schedule notification
  }
  
  Future<void> scheduleAppointmentReminder(
    Appointment appointment,
    DateTime scheduledTime,
  ) async {
    // Schedule notification
  }
}

4. Add Form Screens

Create forms to add/edit data:

  • appointment_form_screen.dart - Add/edit appointments
  • medication_form_screen.dart - Add/edit medications
  • vital_sign_form_screen.dart - Log vital signs
  • activity_form_screen.dart - Log activities

5. Implement Data Persistence

Use Hive for local database:

// lib/services/local_database_service.dart
import 'package:hive_flutter/hive_flutter.dart';

class LocalDatabaseService {
  static Future<void> initialize() async {
    await Hive.initFlutter();
    // Register adapters for models
    await Hive.openBox('appointments');
    await Hive.openBox('medications');
    // etc.
  }
}

6. Add Additional Features

Charts and Analytics

flutter pub add fl_chart

Image Picker (for profile pictures)

flutter pub add image_picker

PDF Export (for reports)

flutter pub add pdf syncfusion_flutter_pdf

7. Implement Providers

Create providers for each feature:

// lib/providers/appointment_provider.dart
class AppointmentProvider extends ChangeNotifier {
  List<Appointment> _appointments = [];
  bool _isLoading = false;
  
  List<Appointment> get appointments => _appointments;
  bool get isLoading => _isLoading;
  
  Future<void> loadAppointments() async {
    _isLoading = true;
    notifyListeners();
    
    // Load from service
    _appointments = await AppointmentService().getAppointments(userId);
    
    _isLoading = false;
    notifyListeners();
  }
  
  Future<void> addAppointment(Appointment appointment) async {
    // Add appointment logic
    notifyListeners();
  }
}

8. Testing

Add tests for your services and providers:

# Run tests
flutter test

9. Platform-Specific Configuration

Android Permissions (android/app/src/main/AndroidManifest.xml)

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>

iOS Permissions (ios/Runner/Info.plist)

<key>NSPhotoLibraryUsageDescription</key>
<string>We need access to your photo library</string>
<key>NSCameraUsageDescription</key>
<string>We need access to your camera</string>

🎨 Customization

Colors

Edit lib/constants/app_constants.dart:

class AppColors {
  static const Color primary = Color(0xFF2196F3);  // Change primary color
  static const Color accent = Color(0xFF03DAC6);    // Change accent color
  // ...
}

Fonts

The app uses Google Fonts (Inter). To change:

textTheme: GoogleFonts.robotoTextTheme(  // Change to any Google Font
  ThemeData.light().textTheme,
),

πŸ“± Running on Devices

Android

flutter run

iOS

flutter run -d ios

Web

flutter run -d chrome

πŸ› Troubleshooting

Build Issues

flutter clean
flutter pub get
flutter run

Package Conflicts

flutter pub upgrade

πŸ“ TODO List

  • Connect to backend API or Firebase
  • Implement actual authentication with secure password storage
  • Add form screens for creating/editing data
  • Implement local notifications for medication reminders
  • Add calendar view for appointments
  • Implement data charts for health tracking
  • Add profile editing functionality
  • Implement emergency SOS functionality (SMS, calls)
  • Add doctor search and booking functionality
  • Implement chat/messaging with doctors
  • Add report generation and export
  • Implement multi-language support
  • Add dark mode theme
  • Implement offline mode with sync
  • Add unit tests and integration tests
  • Set up CI/CD pipeline

πŸ“„ License

This project is licensed under the MIT License.

πŸ‘₯ Contributors

  • Chamindu - Initial Development

πŸ“ž Support

For support, email support@careforelders.com or open an issue in the repository.


Note: This is a working prototype with UI and basic navigation. Backend integration and full CRUD operations need to be implemented for production use.

About

The Care for Elders App is a mobile solution designed to support seniors in managing their health while keeping families and caregivers informed. It brings together essential healthcare and daily living features into one simple, accessible platform that promotes independence, safety, and better well-being for elderly users.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors