Skip to content

Commit

Permalink
Merge pull request #11 from brainwo/readme
Browse files Browse the repository at this point in the history
docs: update README
  • Loading branch information
sonbui00 authored Aug 27, 2024
2 parents b586f55 + 51413eb commit 1a067ff
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<img src="https://avatars.githubusercontent.com/u/96821265?s=200&v=4" height="100" alt="Open Spaced Repetition logo"/>

&nbsp;

[![Pub Version](https://img.shields.io/pub/v/fsrs?label=pub.dev&labelColor=333940&logo=dart)](https://pub.dev/packages/fsrs)
[![License](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://github.com/open-spaced-repetition/dart-fsrs/blob/main/LICENSE)
[![CI Status](https://img.shields.io/github/actions/workflow/status/open-spaced-repetition/dart-fsrs/dart.yml?branch=main&label=CI&labelColor=333940&logo=github)](https://github.com/open-spaced-repetition/dart-fsrs/actions/workflows/dart.yml)

## About The Project

dart-fsrs is a Dart Package implements [Free Spaced Repetition Scheduler algorithm](https://github.com/open-spaced-repetition/free-spaced-repetition-scheduler). It helps developers apply FSRS in their flashcard apps.
Expand All @@ -11,6 +19,7 @@ dart pub add fsrs
## Usage

Create a card and review it at a given time:

```dart
import 'package:fsrs/fsrs.dart';
Expand All @@ -22,15 +31,16 @@ printSchedulingCards(schedulingCards);
```

There are four ratings:

```dart
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
```


Get the new state of card for each rating:

```dart
var cardAgain = schedulingCards[Rating.again]!.card;
var cardHard = schedulingCards[Rating.hard]!.card;
Expand All @@ -39,6 +49,7 @@ var cardEasy = schedulingCards[Rating.easy]!.card;
```

Get the scheduled days for each rating:

```dart
cardAgain.scheduledDays;
cardHard.scheduledDays;
Expand All @@ -47,21 +58,25 @@ cardEasy.scheduledDays;
```

Update the card after rating `Good`:

```dart
card = schedulingCards[Rating.good]!.card;
```

Get the review log after rating `Good`:

```dart
var reviewLog = schedulingCards[Rating.good]!.reviewLog;
```

Get the due date for card:

```dart
due = card.due
```

There are four states:

```dart
State.newState; // Never been studied
State.learning; // Been studied for the first time recently
Expand All @@ -73,6 +88,6 @@ State.relearning; // Forgotten in review state

Distributed under the MIT License. See `LICENSE` for more information.

## More Info:
Port from [email protected]:open-spaced-repetition/py-fsrs.git
commit: 1b4cbe4
## More Info:

Port from [open-spaced-repetition/py-fsrs@1b4cbe4](https://github.com/open-spaced-repetition/py-fsrs/tree/1b4cbe4)

0 comments on commit 1a067ff

Please sign in to comment.