ChecklistEditor: Mark note as empty is it only has one blank item

This commit is contained in:
Vishesh Handa
2020-05-05 10:00:01 +02:00
parent 222697c83d
commit bdecc19126

View File

@ -165,6 +165,12 @@ class ChecklistEditorState extends State<ChecklistEditor>
@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;