How wkkyu088/senior_health_care works
1. Project type and runtime
- This is a Flutter client application called *Senior Health Care*, built to run across Android, iOS, web, macOS, Linux, and Windows from a single Dart codebase.
- The app’s business logic is mostly in lib/; the android/, ios/, web/, macos/, linux/, and windows/ folders are platform shells and launch/runtime configuration.
2. Primary product boundary
- The app appears to support elderly health self-reporting / care tracking for metrics such as blood pressure, blood sugar, heart rate, and weight.
- The main product flow is: authenticate user → enter health measurements → store to cloud → view results/history/summary.
3. App entry and global initialization
- lib/main.dart is the app entry point.
- lib/firebase_options.dart indicates Firebase is initialized through FlutterFire configuration, so app startup likely wires Firebase before routing to screens.
- lib/constants.dart likely holds shared app-wide values such as colors, sizes, or keys.
4. Authentication subsystem
- lib/screens/login_screen.dart, lib/screens/singup_screen.dart, and lib/screens/splash_screen.dart form the authentication/bootstrapping boundary.
- lib/utils/auth.dart is the dedicated auth utility, implying Firebase Authentication or similar identity management is abstracted there.
- The splash screen likely decides whether to route into the authenticated area or back to login based on auth state.
5. Main navigation and app shell
- lib/screens/main_screen.dart is the central post-login container.
- lib/screens/setting_screen.dart is a separate app-level settings surface.
- lib/widgets/custom_appbar.dart and lib/widgets/main_board.dart suggest the main screen is built from reusable header/dashboard components rather than a single monolithic page.
6. Health data input subsystem
- lib/screens/input_screen.dart is the gateway for data entry.
- Specialized input screens exist for each metric:
- blood_pressure_input.dart
- blood_sugar_input.dart
- heart_rate_input.dart
- weight_input.dart
- Shared input UI is factored into lib/widgets/input/, including common form controls, date selection, and “input at once” / multi-submit actions.
7. Health data results and visualization subsystem
- lib/screens/result_screen.dart is the gateway for viewing recorded measurements.
- Metric-specific result screens mirror the input screens:
- blood_pressure_result.dart
- blood_sugar_result.dart
- heart_rate_result.dart
- weight_result.dart
- lib/screens/resultScreens/all_result.dart likely combines multiple metrics into a unified summary view.
- Visualization is handled by reusable widgets such as common_chart_widget.dart, radar_chart.dart, and result button/toggle controls.
8. Data storage and cloud boundary
- lib/utils/firestore.dart is the key persistence layer, strongly suggesting Cloud Firestore is the central backend datastore.
- The architecture likely follows this flow: input screens write measurement documents to Firestore; result screens query Firestore for history, averages, and recent values.
- android/app/google-services.json confirms Firebase is configured on Android; the presence of firebase_options.dart indicates a multi-platform Firebase setup.
9. Reusable UI component layer
- lib/widgets/ contains the app’s shared presentation components:
- average_board.dart, recent_board.dart for dashboard-style summaries
- custom_dialog.dart for modal feedback/confirmation
- custom_appbar.dart for consistent screen chrome
- widgets/input/* and widgets/result/* for domain-specific controls and charts
- This layer isolates styling and interaction patterns so the feature screens stay thin.
10. Assets and branding
- assets/fonts/ includes the Pretendard font family, so typography is intentionally branded and consistent across the app.
- assets/images/ exists, though no specific image files are shown in the tree.
- The app uses standard Flutter asset packaging rather than a separate media pipeline.
11. Platform integration
- Native folders contain only standard Flutter host code and launch scaffolding:
- Android MainActivity.kt
- iOS/macOS Swift app delegates
- desktop runners for Linux/Windows/macOS
- There is no sign of custom native business logic; native code is mainly the platform bridge for Flutter and Firebase.
12. Testing and project maturity
- test/widget_test.dart is present, indicating at least the default Flutter test scaffold.
- analysis_options.yaml, pubspec.yaml, and pubspec.lock show a conventional Flutter-managed build and dependency setup.
13. What to draw in an architecture diagram
- A useful diagram would center on Flutter UI feeding into two cross-cutting services:
- Auth via utils/auth.dart
- Data persistence via utils/firestore.dart
- Above that, show feature clusters:
- authentication screens
- health input screens
- health result/analytics screens
- settings/dashboard shell
- External dependencies to place outside the app boundary: Firebase Authentication, Cloud Firestore, and the Flutter/Firebase platform runtimes.
Main entry points: firestore.dart Firestore util · main_screen.dart Main screen · result_screen.dart Result hub · main.dart main.dart
Components 28
App Core
Startup, configuration, and shared application state
- main.dart · App entry and bootstrap
lib/main.dart - Firebase options · FlutterFire setup values
lib/firebase_options.dart - Constants · App-wide constants and tokens
lib/constants.dart
Access Layer
Authentication and app entry flow
- Splash · Startup routing and auth check
lib/screens/splash_screen.dart - Login · User sign-in UI
lib/screens/login_screen.dart - Sign up · Account creation UI
lib/screens/singup_screen.dart - Main screen · Post-login container and navigation
lib/screens/main_screen.dart - Settings · App-level preferences and options
lib/screens/setting_screen.dart
Measurement Input
Screens and widgets for entering health metrics
- Input hub · Entry point for measurement forms
lib/screens/input_screen.dart - Blood pressure · Blood pressure entry flow
lib/screens/inputScreens/blood_pressure_input.dart - Blood sugar · Blood sugar entry flow
lib/screens/inputScreens/blood_sugar_input.dart - Heart rate · Heart rate entry flow
lib/screens/inputScreens/heart_rate_input.dart - Weight · Weight entry flow
lib/screens/inputScreens/weight_input.dart
Results & Analytics
Screens and widgets for viewing stored measurements
- Result hub · Entry point for measurement history views
lib/screens/result_screen.dart - All results · Combined metrics overview
lib/screens/resultScreens/all_result.dart - Blood pressure · Blood pressure history and charts
lib/screens/resultScreens/blood_pressure_result.dart - Blood sugar · Blood sugar history and charts
lib/screens/resultScreens/blood_sugar_result.dart - Heart rate · Heart rate history and charts
lib/screens/resultScreens/heart_rate_result.dart - Weight · Weight history and charts
lib/screens/resultScreens/weight_result.dart
Shared UI & Services
Reusable widgets and persistence/auth helpers
- Auth util · Authentication abstraction
lib/utils/auth.dart - Firestore util · Cloud persistence and queries
lib/utils/firestore.dart - Shared widgets · Reusable app chrome and dashboards
lib/widgets/custom_appbar.dart - Input widgets · Shared input controls and actions
lib/widgets/input/common_input_widget.dart - Result widgets · Charts, toggles, and result controls
lib/widgets/result/common_chart_widget.dart
Platform Shells
Native runners and Flutter host integration
Connections 44
- main.dart → Firebase options: initializes · Startup loads FlutterFire config
- main.dart → Splash: starts · Entry point routes into auth gate
- Splash → Auth util: checks session · Determines signed-in state
- Splash → Login: routes to · Unauthenticated users go to login
- Login → Auth util: sign in · Uses auth helper for login
- Sign up → Auth util: register · Uses auth helper for account creation
- Login → Sign up: navigates · Moves between auth screens
- Login → Main screen: enters app · Successful auth opens main shell
- Main screen → Input hub: opens input · Primary navigation to measurement entry
- Main screen → Result hub: opens results · Primary navigation to history and summaries
- Main screen → Settings: opens settings · App settings surface
- Input hub → Blood pressure: metric · Blood pressure input flow
- Input hub → Blood sugar: metric · Blood sugar input flow
- Input hub → Heart rate: metric · Heart rate input flow
- Input hub → Weight: metric · Weight input flow
- Blood pressure → Input widgets: uses · Shared form controls and date selection
- Blood sugar → Input widgets: uses · Shared form controls and date selection
- Heart rate → Input widgets: uses · Shared form controls and date selection
- Weight → Input widgets: uses · Shared form controls and date selection
- Blood pressure → Firestore util: writes · Persists measurement records
- Blood sugar → Firestore util: writes · Persists measurement records
- Heart rate → Firestore util: writes · Persists measurement records
- Weight → Firestore util: writes · Persists measurement records
- Result hub → All results: summary · Unified overview of measurements
- Result hub → Blood pressure: metric · Blood pressure results flow
- Result hub → Blood sugar: metric · Blood sugar results flow
- Result hub → Heart rate: metric · Heart rate results flow
- Result hub → Weight: metric · Weight results flow
- All results → Result widgets: uses · Charts and toggle controls
- Blood pressure → Result widgets: uses · Charts and toggle controls
- Blood sugar → Result widgets: uses · Charts and toggle controls
- Heart rate → Result widgets: uses · Charts and toggle controls
- Weight → Result widgets: uses · Charts and toggle controls
- Blood pressure → Firestore util: reads · Queries history and aggregates
- Blood sugar → Firestore util: reads · Queries history and aggregates
- Heart rate → Firestore util: reads · Queries history and aggregates
- Weight → Firestore util: reads · Queries history and aggregates
- Main screen → Shared widgets: uses · Dashboard chrome and summary boards
- Settings → Shared widgets: uses · Shared modal and layout widgets
- Main screen → Constants: styles · Uses shared app constants
- Android → main.dart: hosts · Android Flutter entry host
- iOS → main.dart: hosts · iOS Flutter entry host
- Desktop → main.dart: hosts · Desktop Flutter entry host
- Web → main.dart: hosts · Web Flutter entry host