A comprehensive Flutter mobile application for managing elderly healthcare needs with Firebase backend integration.
Run the app:
# Android Emulator
flutter run
# Chrome (Web)
flutter run -d chrome
# iOS Simulator
flutter run -d ios- π FIREBASE_SECURE_SETUP.md -
β οΈ START HERE - Secure Firebase setup (REQUIRED) - DEVELOPMENT_GUIDE.md - Development instructions & adding features
- FIREBASE_SETUP.md - Firebase configuration guide
- TROUBLESHOOTING.md - Common issues & solutions
- SCREEN_GUIDE.md - All screens and features overview
- SECURITY_ALERT_REMEDIATION.md - Security incident response (if needed)
π SECURITY NOTICE: Firebase configuration files are NOT included in this repository. You must generate your own configuration files. See
FIREBASE_SECURE_SETUP.mdfor instructions.
- User login and registration
- Session management with SharedPreferences
- Splash screen with auto-navigation
- Profile management
- Welcome screen with personalized greeting
- Quick action cards for common tasks
- Today's overview with appointments, medications, and health goals
- Health tips section
- View upcoming and past appointments
- Appointment details (doctor, date, location, purpose)
- Quick actions (reschedule, view details)
- Add new appointments (UI ready)
- Today's medication schedule
- Mark medications as taken
- View all medications with dosage information
- Refill alerts for low stock
- Add new medications (UI ready)
- Vital signs monitoring (Blood Pressure, Heart Rate, Blood Sugar, Temperature)
- Activity logging (Walking, Yoga, etc.)
- Wellness goals with progress tracking
- Visual progress indicators
- 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)
- User information display
- Personal and medical information
- Settings and preferences
- Logout functionality
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
- Flutter SDK (3.9.0 or higher)
- Dart SDK
- Android Studio / Xcode (for iOS)
- A physical device or emulator
-
Clone the repository
cd /Users/chamindu/Documents/GitHub/care-for-elders -
Install dependencies
flutter pub get
-
Run the app
flutter run
For testing, use any email and password with at least 4 characters:
- Email:
test@example.com - Password:
1234
provider: ^6.1.1- State managementgoogle_fonts: ^6.1.0- Custom fontsshared_preferences: ^2.2.2- Local storagehive: ^2.2.3- NoSQL databaseintl: ^0.19.0- Date formatting
flutter_local_notifications: ^17.0.0- Push notificationsurl_launcher: ^6.2.2- Phone calls and URLspermission_handler: ^11.1.0- App permissionstable_calendar: ^3.0.9- Calendar widget
Currently, the app uses dummy data. To make it production-ready:
# Add Firebase packages
flutter pub add firebase_core firebase_auth cloud_firestore firebase_storageThen:
- Set up Firebase project at console.firebase.google.com
- Configure Firebase for Android/iOS
- Replace
AuthServicewith Firebase Authentication - Store data in Cloud Firestore
- Create services for each feature (AppointmentService, MedicationService, etc.)
- Implement HTTP calls using
httpordiopackage - Handle authentication tokens
- Implement error handling and retry logic
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
}
}// 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
}
}Create forms to add/edit data:
appointment_form_screen.dart- Add/edit appointmentsmedication_form_screen.dart- Add/edit medicationsvital_sign_form_screen.dart- Log vital signsactivity_form_screen.dart- Log activities
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.
}
}flutter pub add fl_chartflutter pub add image_pickerflutter pub add pdf syncfusion_flutter_pdfCreate 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();
}
}Add tests for your services and providers:
# Run tests
flutter test<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/><key>NSPhotoLibraryUsageDescription</key>
<string>We need access to your photo library</string>
<key>NSCameraUsageDescription</key>
<string>We need access to your camera</string>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
// ...
}The app uses Google Fonts (Inter). To change:
textTheme: GoogleFonts.robotoTextTheme( // Change to any Google Font
ThemeData.light().textTheme,
),flutter runflutter run -d iosflutter run -d chromeflutter clean
flutter pub get
flutter runflutter pub upgrade- 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
This project is licensed under the MIT License.
- Chamindu - Initial Development
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.