change a bunch of stuff, seperate tracking for progress, updated custom srs layout
This commit is contained in:
@@ -50,12 +50,20 @@ class _AddCardScreenState extends State<AddCardScreen> {
|
||||
|
||||
void _saveCard() {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
final srsData = _useInterval
|
||||
? SrsData(
|
||||
japaneseToEnglishNextReview: DateTime.now(),
|
||||
englishToJapaneseNextReview: DateTime.now(),
|
||||
listeningComprehensionNextReview: DateTime.now(),
|
||||
)
|
||||
: SrsData();
|
||||
|
||||
final newItem = CustomKanjiItem(
|
||||
characters: _japaneseController.text,
|
||||
meaning: _englishController.text,
|
||||
kanji: _kanjiController.text.isNotEmpty ? _kanjiController.text : null,
|
||||
kanji: _kanjiController.text.trim().isNotEmpty ? _kanjiController.text.trim() : null,
|
||||
useInterval: _useInterval,
|
||||
nextReview: _useInterval ? DateTime.now() : null,
|
||||
srsData: srsData,
|
||||
);
|
||||
_deckRepository.addCard(newItem);
|
||||
Navigator.of(context).pop();
|
||||
|
||||
Reference in New Issue
Block a user