flutter_spaced_repetition 1.0.0
flutter_spaced_repetition: ^1.0.0 copied to clipboard
A pure Dart implementation of the SM-2 spaced repetition algorithm for Flutter apps. Perfect for flashcard apps, language learning, and any spaced learning application.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.0 - 2025-01-21 #
Added #
-
Core Models
ReviewCard- Complete card state with phase tracking, statistics, and metadata supportReviewQuality- Type-safe enum with Again, Hard, Good, Easy ratingsSRSSettings- 17+ fully configurable parameters (no dead code!)ReviewResult- Immutable review outcome with transition metadataIntervalPreview- Preview intervals for UI button display
-
Algorithms
SM2Algorithm- Classic SuperMemo 2 implementationSM2PlusAlgorithm- Enhanced SM-2 with overdue bonus calculationCustomAlgorithm- Build your own with interval and ease callbacksSRSAlgorithm- Abstract interface for custom implementations
-
Spaced Repetition Engine
SpacedRepetitionEngine- Main API for card management- Card creation, review processing, batch operations
- Card suspension, reset, and rescheduling
- Due card filtering and priority sorting
-
Review Scheduler
ReviewScheduler- Session management with configurable limitsSchedulerConfig- Configure new cards, reviews per session- Priority-based card ordering (overdue > learning > new)
- Multiple scheduling modes (interleaved, new first, review first)
-
Statistics
CardStatistics- Per-card metrics (success rate, stability, difficulty)DeckStatistics- Aggregate deck analyticsMasteryCalculator- Mastery levels from Not Started to Expert- Streak tracking, retention analysis, workload estimation
-
Utilities
IntervalFormatter- Human-readable interval formatting (1m, 10m, 1d, 7d)SRSValidator- Input validation for all parametersSRSSerializer- Full deck import/export support
-
Configuration Presets
SRSSettings.anki()- Standard Anki defaultsSRSSettings.supermemo()- Original SuperMemo settingsSRSSettings.aggressive()- Faster learning curveSRSSettings.relaxed()- Lower review burden
-
Documentation
- Comprehensive README with examples
- Full API documentation
- Working example application
Technical Highlights #
- Pure Dart - no dependencies, works everywhere (Flutter, CLI, server)
- 138+ unit and integration tests
- All settings are functional (fixed 9 dead code issues from original)
- Zero hardcoded algorithm values
- Full JSON serialization support
- Immutable card updates
Credits #
- Based on the SM-2 algorithm by Piotr Wozniak
- Inspired by Anki and SuperMemo
- Extracted and improved from the Revisable app