### Run Example App Source: https://github.com/java-james/sm2/blob/master/README.md Instructions to navigate to the example directory and run the Flutter example app to interactively test the spaced repetition algorithm. ```sh cd example flutter run ``` -------------------------------- ### Flutter Example App Analysis and Testing Source: https://github.com/java-james/sm2/blob/master/README.md Commands to analyze code quality and run tests for the Flutter example application. ```sh cd example flutter analyze flutter test ``` -------------------------------- ### Calculate next review interval (Quick Start) Source: https://github.com/java-james/sm2/blob/master/README.md Demonstrates the basic usage of the Sm2 class to calculate the next review interval, repetitions, and ease factor based on recall quality and previous state. ```dart import 'package:spaced_repetition/spaced_repetition.dart'; void main() { final result = Sm2().calc( quality: 5, repetitions: 0, previousInterval: 0, previousEaseFactor: 2.5, ); print(result.interval); // 1 print(result.repetitions); // 1 print(result.easeFactor); // 2.6 } ``` -------------------------------- ### Install spaced_repetition for Dart Source: https://github.com/java-james/sm2/blob/master/README.md Add the spaced_repetition package to your Dart project dependencies. ```sh dart pub add spaced_repetition ``` -------------------------------- ### Install spaced_repetition for Flutter Source: https://github.com/java-james/sm2/blob/master/README.md Add the spaced_repetition package to your Flutter project dependencies. ```sh flutter pub add spaced_repetition ``` -------------------------------- ### Development Analysis and Testing Source: https://github.com/java-james/sm2/blob/master/README.md Commands to analyze code quality and run tests for the Dart package. ```sh dart analyze dart test ``` -------------------------------- ### SM-2 Algorithm Behavior - Ease Factor Update Source: https://github.com/java-james/sm2/blob/master/README.md Illustrates the formula used to update the ease factor after each review, which is crucial for adjusting future intervals based on recall performance. ```dart easeFactor = previousEaseFactor + (0.1 - (5 - quality) * (0.08 + (5 - quality) * 0.02)); ``` -------------------------------- ### Update card state after review Source: https://github.com/java-james/sm2/blob/master/README.md Shows how to use the result of Sm2().calc to update the card's interval, repetitions, ease factor, and due date for the next review. ```dart final next = Sm2().calc( quality: userScore, repetitions: card.repetitions, previousInterval: card.interval, previousEaseFactor: card.easeFactor, ); card ..interval = next.interval ..repetitions = next.repetitions ..easeFactor = next.easeFactor ..dueAt = DateTime.now().add(Duration(days: next.interval)); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.