How sidhant947/learnmath works
LearnMath is a Flutter mental-math training game, playable in a browser and distributed for Android. The intended user journey is to enter the app, choose a level or mode, solve math challenges, and review progress; the tree also shows settings, localized UI, and learning aids. Feature paths are taken from the tree, but their implementations were not excerpted, so internal control and data-flow links are dashed and unverified. The README establishes the product and platforms, but does not document the detailed gameplay flow.
Main entry points: math_game_screen.dart Game screen · progress_repository.dart Progress repository · home_view.dart Home · main.dart App entry
Components 24
App experience
- App entry
lib/main.dart - Home
lib/ui/features/home/views/home_view.dart - Home state
lib/ui/features/home/view_models/home_view_model.dart - Level selection
lib/ui/features/level_select/views/level_select_view.dart
Math challenges
- Game screen
lib/ui/features/game/math_game/math_game_screen.dart - Game state
lib/ui/features/game/math_game/math_game_provider.dart - Challenge engine
lib/ui/features/game/math_game/math_game_engine.dart - Math problem
lib/domain/models/math_problem.dart - Duel mode
lib/ui/features/modes/duel/duel_screen.dart - Survival mode
lib/ui/features/modes/survival/survival_screen.dart - Target 24 mode
lib/ui/features/modes/target24/target24_screen.dart - Time attack
lib/ui/features/modes/time_attack/time_attack_screen.dart
Learning aids
- Step explanations
lib/ui/core/widgets/step_explanation_modal.dart - Math visualizer
lib/ui/core/widgets/rich_math_visualizer.dart - Scratchpad
lib/ui/core/widgets/scratchpad_modal.dart
Progress and settings
- Statistics
lib/ui/features/stats/stats_view.dart - Progress repository
lib/data/repositories/progress_repository.dart - User progress
lib/domain/models/user_progress.dart - Badges
lib/domain/models/badge_item.dart - Settings
lib/ui/features/settings/views/settings_view.dart
App foundation
- Local persistence
lib/data/services/hive_service.dart - Progress adapter
lib/data/services/user_progress_adapter.dart - Localization
lib/l10n/app_localizations.dart
Other components
- Player
Connections 24
- Player → App entry: opens
README.md - App entry → Home: starts
- Home → Home state: uses state
- Home → Level selection: offers levels
- Level selection → Game screen: starts challenge
- Home → Game screen: starts play
- Game screen → Game state: uses state
- Game state → Challenge engine: delegates challenge
- Challenge engine → Math problem: creates problems
- Game screen → Duel mode: offers mode
- Game screen → Survival mode: offers mode
- Game screen → Target 24 mode: offers mode
- Game screen → Time attack: offers mode
- Game screen → Step explanations: shows steps
- Step explanations → Math visualizer: visualizes math
- Game screen → Scratchpad: opens scratchpad
- Game screen → Progress repository: records results
- Statistics → Progress repository: reads progress
- Progress repository → User progress: maps progress
- Progress repository → Badges: uses badges
- Progress repository → Local persistence: persists data
- Progress repository → Progress adapter: adapts progress
- Settings → Local persistence: stores preferences
- Home → Localization: uses strings