spaced_repetition 0.1.0 copy "spaced_repetition: ^0.1.0" to clipboard
spaced_repetition: ^0.1.0 copied to clipboard

Simple implementation of the sm2 spaced repetition algorithm. It calculates the number of days to wait before reviewing a piece of information based on how easily the the information was remembered today.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:sm2/main.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: HomePage(),
    );
  }
}
class HomePage extends StatelessWidget {

  final sm = Sm();
  
  @override
  @override
  Widget build(BuildContext context) {
    SmResponse smResponse = sm.calc(
      quality: 0,
      repetitions: 0,
      previousInterval: 0,
      previousEaseFactor: 2.5
    );
    return Scaffold(
      appBar: AppBar(
        title: Text('Spaced Repetition'),
        centerTitle: true,
      ),
      body: Container(
        padding: const EdgeInsets.all(10.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Text("Repetitions: ${smResponse.repetitions}"),
            Text("Interval: ${smResponse.interval}"),
            Text("Ease Factor: ${smResponse.easeFactor}")
          ],
        ),
      ),
    );
  }
}
3
likes
140
pub points
76%
popularity

Publisher

unverified uploader

Simple implementation of the sm2 spaced repetition algorithm. It calculates the number of days to wait before reviewing a piece of information based on how easily the the information was remembered today.

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

flutter

More

Packages that depend on spaced_repetition