The JK Jung Times
TECHNOLOGY

Implementing Spaced Repetition from Scratch in Dart

Why I built a custom SRS engine instead of using SM-2, and how offline-first design shaped every algorithmic decision.

By JK Jung, Staff Developer | Los Angeles Bureau | Thursday, April 16, 2026

Implementing Spaced Repetition from Scratch in Dart

Spaced repetition is the backbone of Flashcards Alarm's learning effectiveness. The algorithm determines which cards to show and when, based on how well the user remembers each card. Get it right, and users learn faster with less effort. Get it wrong, and they're either bored reviewing easy cards or frustrated by cards they've never seen.

The

▶ Continued from Page 1

cognitive science is well-established. Hermann Ebbinghaus demonstrated the forgetting curve in 1885 — memory retention decays exponentially without reinforcement. Spaced repetition exploits this by scheduling reviews at the precise moment a memory is about to fade. The mathematical challenge is predicting that moment for each individual card and each individual learner, which is where algorithmic implementations diverge.

The classic SM-2 algorithm (used by Anki) is well-proven but designed for desktop software with reliable internet. Flashcards Alarm needed an SRS engine that works offline, syncs gracefully, and handles the unique constraint that study sessions happen during alarm dismissal — users can't choose which cards to study

...

Tags: Algorithms, Dart, Flutter, Education