finish custom srs for now

This commit is contained in:
Rene Kievits
2025-10-30 17:41:53 +01:00
parent ee4fd7ffc1
commit d8a5c27fb3
2 changed files with 87 additions and 35 deletions

View File

@@ -31,6 +31,17 @@ class CustomDeckRepository {
}
}
Future<void> updateCards(List<CustomKanjiItem> itemsToUpdate) async {
final deck = await getCustomDeck();
for (var item in itemsToUpdate) {
final index = deck.indexWhere((element) => element.characters == item.characters);
if (index != -1) {
deck[index] = item;
}
}
await saveDeck(deck);
}
Future<void> deleteCard(CustomKanjiItem item) async {
final deck = await getCustomDeck();
deck.removeWhere((element) => element.characters == item.characters);