add a shit ton of feature for the custom srs

This commit is contained in:
Rene Kievits
2025-10-30 03:44:04 +01:00
parent b58a4020e1
commit ee4fd7ffc1
13 changed files with 787 additions and 311 deletions

View File

@@ -18,6 +18,7 @@ class _AddCardScreenState extends State<AddCardScreen> {
final _kanjiController = TextEditingController();
final _kanaKit = const KanaKit();
final _deckRepository = CustomDeckRepository();
bool _useInterval = false;
@override
void initState() {
@@ -53,6 +54,8 @@ class _AddCardScreenState extends State<AddCardScreen> {
characters: _japaneseController.text,
meaning: _englishController.text,
kanji: _kanjiController.text.isNotEmpty ? _kanjiController.text : null,
useInterval: _useInterval,
nextReview: _useInterval ? DateTime.now() : null,
);
_deckRepository.addCard(newItem);
Navigator.of(context).pop();
@@ -106,6 +109,16 @@ class _AddCardScreenState extends State<AddCardScreen> {
return null;
},
),
const SizedBox(height: 16),
SwitchListTile(
title: const Text('Use Interval-based SRS'),
value: _useInterval,
onChanged: (value) {
setState(() {
_useInterval = value;
});
},
),
const SizedBox(height: 32),
ElevatedButton(
onPressed: _saveCard,