How lungmen-hkm/traincenter works
TrainCenter is a privacy-first Flutter activity tracker with no account or backend; activities, gear, segments, and settings are stored locally. The main workflow is GPS recording, reviewing and confirming a finished activity, then saving it for history and automatic segment-effort matching. Other capabilities include gear management, activity details, transparent PNG export, and appearance settings. Relationships below follow README documentation; Dart implementation files were not sampled, so undocumented calls are omitted.
Main entry points: finish_screen.dart Finish confirmation · export_sheet.dart PNG export · activity_repository.dart Activity repository · record_screen.dart Record screen
Components 24
Recording
- Record screen
lib/features/record/record_screen.dart - Record controller
lib/features/record/record_controller.dart - Location service
lib/core/services/location_service.dart - Background tracking
lib/core/services/background_location_service.dart - Training map
lib/core/widgets/train_center_map.dart - Finish confirmation
lib/features/finish/finish_screen.dart - Slide to confirm
lib/core/widgets/slide_to_confirm.dart
Activities
- Activity history
lib/features/activities/activities_screen.dart - Activity detail
lib/features/activities/activity_detail_screen.dart - PNG export
lib/features/export/export_sheet.dart - Export card
lib/features/export/activity_export_card.dart - Gear management
lib/features/gear/gear_screen.dart - Segment management
lib/features/segments/segments_screen.dart
Domain and Data
- Segment matcher
lib/domain/services/segment_matcher.dart - Effort service
lib/data/services/segment_effort_service.dart - Activity repository
lib/data/repositories/activity_repository.dart - Local database
lib/core/db/app_database.dart
App Services
- App shell
lib/app.dart - Bootstrap
lib/main.dart - App settings
lib/features/settings/app_settings.dart - Settings screen
lib/features/settings/settings_screen.dart
Other components
- Athlete
- Native share sheet
- Downloads folder
Connections 22
- Athlete → Record screen: starts recording
README.md - Record screen → Record controller: controls
README.md - Record controller → Location service: reads GPS
README.md - Record controller → Background tracking: tracks in background
README.md - Record screen → Training map: shows route
README.md - Athlete → Finish confirmation: reviews activity
README.md - Finish confirmation → Slide to confirm: confirms save
README.md - Finish confirmation → Activity repository: saves activity
README.md - Bootstrap → Local database: opens database
README.md - Bootstrap → App shell: runs app
README.md - Activity history → Activity repository: loads history
README.md - Activity detail → Activity repository: loads activity
README.md - Activity detail → PNG export: opens export
README.md - PNG export → Export card: captures card
README.md - PNG export → Downloads folder: saves PNG
README.md - PNG export → Native share sheet: shares image
README.md - Gear management → Activity repository: updates distance on save
README.md - Segment management → Segment matcher: defines segments
README.md - Finish confirmation → Segment matcher: triggers matching after save
README.md - Segment matcher → Effort service: computes and persists efforts
README.md - Settings screen → App settings: changes appearance
README.md - App settings → Local database: stores preferences
README.md