mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-30 02:59:02 +08:00
ChecklistEditor: Mark note as empty is it only has one blank item
This commit is contained in:
@ -165,6 +165,12 @@ class ChecklistEditorState extends State<ChecklistEditor>
|
|||||||
@override
|
@override
|
||||||
Note getNote() {
|
Note getNote() {
|
||||||
var note = checklist.note;
|
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.title = _titleTextController.text.trim();
|
||||||
note.type = NoteType.Checklist;
|
note.type = NoteType.Checklist;
|
||||||
return note;
|
return note;
|
||||||
|
Reference in New Issue
Block a user