sm2 0.1.6 copy "sm2: ^0.1.6" to clipboard
sm2: ^0.1.6 copied to clipboard

Simple 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: 2.5,
      previousEaseFactor: 0
    );
    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}")
          ],
        ),
      ),
    );
  }
}
11
likes
35
pub points
0%
popularity

Publisher

unverified uploader

Simple 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

License

GPL-3.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on sm2