From bdecc191260d81d4dea046f8f3426167c2d6105e Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Tue, 5 May 2020 10:00:01 +0200 Subject: [PATCH] ChecklistEditor: Mark note as empty is it only has one blank item --- lib/editors/checklist_editor.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/editors/checklist_editor.dart b/lib/editors/checklist_editor.dart index 2237f2f4..e40ced4d 100644 --- a/lib/editors/checklist_editor.dart +++ b/lib/editors/checklist_editor.dart @@ -165,6 +165,12 @@ class ChecklistEditorState extends State @override Note getNote() { var note = checklist.note; + if (checklist.items.length == 1) { + var item = checklist.items.first; + if (item.checked == false && item.text.trim().isEmpty) { + note.body = ""; + } + } note.title = _titleTextController.text.trim(); note.type = NoteType.Checklist; return note;