add a shit ton of feature for the custom srs
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user