Add the concept of Editors

* We no longer have a separate editing and browsing view - This does
mean we loose the ability to quick flip between notes by swiping.
However, this is more how a note editor would behave. I do later want to
add that capability back.

* We have 2 editors for now - Markdown and Raw. By default we use the
Markdown editor which can be toggled between Preview / Edit mode.

I later want to add a rich text editor and a todo editor as well.
This commit is contained in:
Vishesh Handa
2020-01-28 23:43:47 +01:00
parent 127faa39cf
commit 3f40a2992a
11 changed files with 584 additions and 458 deletions

View File

@ -151,11 +151,6 @@ class StateContainerState extends State<StateContainer> {
}
void renameNote(Note note, String newFileName) async {
// Do not let the user rename it to a non-markdown file
if (!newFileName.toLowerCase().endsWith('.md')) {
newFileName += '.md';
}
var oldNotePath = note.filePath;
note.rename(newFileName);
@ -181,8 +176,8 @@ class StateContainerState extends State<StateContainer> {
});
}
void undoRemoveNote(Note note, int index) {
note.parent.insert(index, note);
void undoRemoveNote(Note note) {
note.parent.insert(0, note);
_gitRepo.resetLastCommit().then((NoteRepoResult _) {
syncNotes();
});