Remove all reminders with no value

This commit is contained in:
konrad 2019-03-17 20:00:51 +01:00
parent b6b113c106
commit 98b518df9d
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -224,8 +224,10 @@ class _TaskEditPageState extends State<TaskEditPage> {
_saveTask(BuildContext context) async {
setState(() => _loading = true);
// FIXME: is there a way we can update the task without creating a new task object?
// aka updating the existing task we got from context (setters?)
// Removes all reminders with no value set.
_reminderDates.removeWhere((d) => d == null);
Task updatedTask = Task(
id: widget.task.id,
text: _text,
@ -257,17 +259,4 @@ class _TaskEditPageState extends State<TaskEditPage> {
);
});
}
_reminderDatesInput() {
_reminderDates = widget.task.reminderDates;
_reminderDates?.asMap()?.forEach(
(i, time) => setState(() => _reminderInputs?.add(VikunjaDateTimePicker(
initialValue: time,
label: 'Reminder',
onSaved: (reminder) => _reminderDates[i] = reminder,
))));
//return _reminderInputs;
}
}