NoteBrowser: Add a button to rename notes

Fixes #23
This commit is contained in:
Vishesh Handa
2020-01-27 23:09:11 +01:00
parent 35f8559c74
commit f8e7773f16
4 changed files with 70 additions and 0 deletions

View File

@ -150,6 +150,15 @@ class StateContainerState extends State<StateContainer> {
});
}
void renameNote(Note note, String newFileName) async {
var oldNotePath = note.filePath;
note.rename(newFileName);
_gitRepo.renameNote(oldNotePath, note.filePath).then((NoteRepoResult _) {
syncNotes();
});
}
void addNote(Note note) {
insertNote(0, note);
}