Last updated:
0 purchases
fsrs
About The Project #
dart-fsrs is a Dart Package implements Free Spaced Repetition Scheduler algorithm. It helps developers apply FSRS in their flashcard apps.
Getting Started #
dart pub add fsrs
copied to clipboard
Usage #
Create a card and review it at a given time:
import 'package:fsrs/fsrs.dart';
var f = FSRS();
var card = Card();
var now = DateTime(2022, 11, 29, 12, 30, 0, 0);
var schedulingCards = f.repeat(card, now);
printSchedulingCards(schedulingCards);
copied to clipboard
There are four ratings:
Rating.again; // forget; incorrect response
Rating.hard; // recall; correct response recalled with serious difficulty
Rating.good; // recall; correct response after a hesitation
Rating.easy; // recall; perfect response
copied to clipboard
Get the new state of card for each rating:
var cardAgain = schedulingCards[Rating.again]!.card;
var cardHard = schedulingCards[Rating.hard]!.card;
var cardGood = schedulingCards[Rating.good]!.card;
var cardEasy = schedulingCards[Rating.easy]!.card;
copied to clipboard
Get the scheduled days for each rating:
cardAgain.scheduledDays;
cardHard.scheduledDays;
cardGood.scheduledDays;
cardEasy.scheduledDays;
copied to clipboard
Update the card after rating Good:
card = schedulingCards[Rating.good]!.card;
copied to clipboard
Get the review log after rating Good:
var reviewLog = schedulingCards[Rating.good]!.reviewLog;
copied to clipboard
Get the due date for card:
due = card.due
copied to clipboard
There are four states:
State.newState; // Never been studied
State.learning; // Been studied for the first time recently
State.review; // Graduate from learning state
State.relearning; // Forgotten in review state
copied to clipboard
License #
Distributed under the MIT License. See LICENSE for more information.
More Info: #
Port from [email protected]:open-spaced-repetition/py-fsrs.git
commit: 1b4cbe4
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.