diff --git a/lib/core/notes_folder_fs.dart b/lib/core/notes_folder_fs.dart index 6bab0c3c..faa2148b 100644 --- a/lib/core/notes_folder_fs.dart +++ b/lib/core/notes_folder_fs.dart @@ -247,17 +247,6 @@ class NotesFolderFS with NotesFolderNotifier implements NotesFolder { notifyNoteAdded(_notes.length - 1, note); } - void insert(int index, Note note) { - assert(note.parent == this); - assert(index >= 0); - note.addModifiedListener(_noteModified); - - _notes.insert(index, note); - _entityMap[note.filePath] = note; - - notifyNoteAdded(index, note); - } - void remove(Note note) { assert(note.parent == this); note.removeModifiedListener(_noteModified); diff --git a/lib/state_container.dart b/lib/state_container.dart index 24964368..3ad373f9 100644 --- a/lib/state_container.dart +++ b/lib/state_container.dart @@ -200,7 +200,7 @@ class StateContainer with ChangeNotifier { void addNote(Note note) async { return _opLock.synchronized(() async { Log.d("State Container addNote"); - note.parent.insert(0, note); + note.parent.add(note); note.updateModified(); _gitRepo.addNote(note).then((NoteRepoResult _) { _syncNotes(); @@ -225,7 +225,7 @@ class StateContainer with ChangeNotifier { void undoRemoveNote(Note note) async { return _opLock.synchronized(() async { - note.parent.insert(0, note); + note.parent.add(note); _gitRepo.resetLastCommit().then((NoteRepoResult _) { _syncNotes(); });