A Flutter-based mental math app that presents timed math questions with multiple choice answers. Test your arithmetic skills across different difficulty levels, track your progress over time, and follow a structured learning path with Journey mode.
- Timed Questions: Answer math problems within a 30-second time limit
- Multiple Operations: Addition, subtraction, multiplication, and division
- Difficulty Levels: Three ranges - Easy (1-10), Medium (1-100), Hard (1-1000)
- Journey Mode: Structured learning path with progressive difficulty and achievement tracking
- Progress Tracking: Comprehensive statistics and performance analytics
- Streak Tracking: Monitor current and best answer streaks
The Journey mode provides a structured learning experience that guides users through progressively challenging math problems:
- Progressive Difficulty: 12 steps covering each operation (addition, subtraction, multiplication, division) across three difficulty levels
- Step Unlocking: Complete previous steps to unlock new challenges
- Achievement System: Steps are completed when achieving 90% accuracy with at least 10 attempts
- Visual Progress: Track your journey with progress indicators and completion status
- Dedicated Statistics: Journey mode maintains separate statistics from regular practice
- Addition Easy (1-10)
- Addition Medium (1-100)
- Addition Hard (1-1000)
- Subtraction Easy (1-10)
- Subtraction Medium (1-100)
- Subtraction Hard (1-1000)
- Multiplication Easy (1-10)
- Multiplication Medium (1-100)
- Multiplication Hard (1-1000)
- Division Easy (1-10)
- Division Medium (1-100)
- Division Hard (1-1000)
The app uses a clean model-based architecture:
- Defines four math operations: addition, subtraction, multiplication, division
- Provides calculation logic and display symbols
- Includes string conversion utilities
- Represents a single math question with two operands and an operation
- Generates four multiple choice options (one correct, three incorrect)
- Validates that options include the correct answer
- Records user performance data for analytics
- Stores date, operation type, difficulty level, result, and journey mode flag
- Serializable for local storage via Hive
- Captures user's answer to a specific question
- Tracks correctness and selected option
- Journey: Manages the complete learning path with 12 progressive steps
- JourneyStep: Represents individual challenges with operation, difficulty, and completion status
- JourneyDifficulty: Enum defining easy, medium, and hard difficulty levels
- Tracks unlock status, completion, accuracy, and attempt counts
- Generates sets of 10 random questions
- Supports filtering by operations and difficulty ranges
- Special logic for division to ensure clean integer results
- Creates unique incorrect options for each question
- Handles all data persistence using Hive local database
- Tracks question attempts and performance metrics
- Provides analytics methods:
- Overall accuracy calculations
- Performance by operation/difficulty
- Daily/weekly accuracy trends
- Streak calculations
- Time-based filtering
- Journey vs. regular mode separation
- Manages Journey mode progression and state
- Handles step unlocking logic based on performance
- Tracks completion status (90% accuracy with 10+ attempts)
- Provides journey statistics and progress calculations
- Supports journey reset functionality
- Manages current question set and user responses
- Tracks answered questions during a session
- Provides methods to record answers and check completion status
- Handles question set replacement for new sessions
- Manages Journey mode state and progress
- Provides real-time journey data updates
- Handles journey refresh and invalidation
- Framework: Flutter
- State Management: Riverpod
- Local Storage: Hive
- Navigation: GoRouter
- Architecture Pattern: Provider + Service Layer
- Question Generation:
QuestionGeneratorcreates random questions based on selected operations and difficulty - State Management:
QuestionProvidermanages the current session state - Journey Progression:
JourneyServicetracks step completion and unlocking - User Interaction: Questions are presented with timed multiple choice interface
- Data Persistence:
StatsServicerecords attempts to local Hive database with mode separation - Analytics: Historical data is processed for performance insights and progress tracking
lib/
├── models/ # Data models
│ ├── operation.dart
│ ├── question.dart
│ ├── question_attempt.dart
│ ├── question_response.dart
│ └── journey.dart # Journey models
├── providers/ # State management
│ └── question_provider.dart
├── services/ # Business logic
│ ├── question_generator.dart
│ ├── stats_service.dart
│ └── journey_service.dart # Journey management
├── screens/ # UI screens
│ ├── journey/ # Journey mode screens
│ │ └── journey_screen.dart
│ └── ...
└── theme.dart # App theming
- Clone the repository
- Run
flutter pub getto install dependencies - Run
dart run build_runner watchfor code generation - Launch with
flutter run
The app initializes Hive storage on startup and is ready to generate questions immediately. Journey mode is available from the main menu and provides a structured learning experience.
- Regular Mode: Practice with custom operation and difficulty selections
- Journey Mode: Follow the structured 12-step learning path
- Statistics: View performance analytics for both modes
- Settings: Configure app preferences and reset journey progress