This reverts commit a7b25cece14dec12118cb63e05a0f2cb4b9cf36e.
The Crashlytics symbols uploder complains a lot - That it is
experimental and unsupported.
For safety we're only allowing non-empty folders to be deleted. Ideally,
we should have some kind of undo button. Or some kind of history - since
we do have that with git.
Related to #18
Now whenever we run 'flutter run' or 'flutter build' we need to pass the
flavour flag. It seems there is no way to set a default flavour.
This is required as I want to be able to not have to reconfigure my
local GitJournal app (which I use for note-taking) vs the one I'm
developing where I might change many different settings for the basis of
testing.
Specially since I don't use Github/GitLab to store my notes, so the
setup process is a bit more involved.
It's a bit confusing that the created date has to be set when creating a
new note, and the path had to be constructured properly, without which
the note shouldn't be saved. Ideally, an object shouldn't be able exist
in such an inconsistent state.
We aren't using it, and if we implement a recursive option it should
somehow showcase which folder it is under. Evernote does it in an
interesting way.
Also sort the notes based on when last modified. Now that we're moving
towards being a more note-taking app, it makes sense that a recently
modified note goes on top.
Of course, the sorting should be controllable by the user, but the
default probably should be by when modified.
Also make sure the _entities and _entityMap are always in sync.
The NotesFolder is complex enough that it could really use some proper
unit testing. Though since it is so tightly coupled to the FileSystem,
it would be quite an elaborate test to write.
Earlier whenever anything changed we would discard all the Notes +
NotesFolders in memory, and reconstruct the hierarchy. This would means
Notes which haven't changed at all, still need to parsed all over again.
Now we only reload what has actually changed.
This should result in a huge performance boost.
We still shouldn't be loading everything on boot, but that's a different
problem.
A NotesFolder doesn't only change when a note/folder is added or
removed. It is also changed when the contents of the Notes/Folders it
contains have changed.
This is our first use case of trying to use 'Provider' for state
management. Right now, we're doing state management quite horribly as
all the widgets are rebuilt whenever the state of the app changes.
With this, we can now start to refactor and only rebuild the widgets
whose data has changed.
There we many many different state management solutions to choose from,
I've settled on Provider, as it seems like the simplest to integrate
into the code base. Bloc/Redux seemed like they would add too much
complexity for me.
This is a huge change which involves -
* Implementing Folder renames on the FS + Git level
* Implementing the concept of selecting an item in the FoldersListView,
this feature isn't provided by default, and even now I'm not sure if
the semantics which I've implemented are correct. I haven't
implemented multiple folder selection for now.
Related to issue #18
Also, we're now one step closer to allowing notes to be renamed (#23)
This looks okayish in normal mode, but looks very ugly in dark mode, so
I'm not enabling this. But I don't want to discard this experiment, so
here I am committing this code.