Skip to main content

fsrs_dart 0.3.0 copy "fsrs_dart: ^0.3.0" to clipboard
fsrs_dart: ^0.3.0 copied to clipboard

Free Spaced Repetition Scheduler (FSRS-7 and FSRS-6) for Dart and Flutter, powered by the official Rust fsrs-rs engine via FFI.

example/example.dart

import 'package:fsrs_dart/fsrs_dart.dart';

void main() {
  final scheduler = FsrsScheduler();
  final now = DateTime.now().toUtc();

  final card = FsrsCard.create(now: now);

  final preview = scheduler.preview(card, now: now);
  for (final rating in FsrsRating.values) {
    print('${rating.name}: due in ${preview[rating].log.interval}');
  }

  final result = scheduler.review(card, FsrsRating.good, now: now);
  print('Due: ${result.card.due}');

  if (result.card case FsrsActiveCard(:final memory)) {
    print('Stability: ${memory.stability}');
    print('Difficulty: ${memory.difficulty}');
  }

  final recall = scheduler.retrievability(
    result.card,
    now: now.add(const Duration(days: 1)),
  );
  print('Retrievability: ${(recall! * 100).toStringAsFixed(1)}%');
}
1
likes
160
points
162
downloads

Documentation

API reference

Publisher

verified publisherpusk.software

Weekly Downloads

Free Spaced Repetition Scheduler (FSRS-7 and FSRS-6) for Dart and Flutter, powered by the official Rust fsrs-rs engine via FFI.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

code_assets, convert, crypto, ffi, hooks, meta, native_toolchain_rust

More

Packages that depend on fsrs_dart