We now have a much clearer separation between Git code and this app
specific code. This is awesome, it will allow other people to easily
integrate Git within their apps. Also, eventually it will be trivial to
switch to another implemention of Git (via JGit or a git client written
completely in Dart)
This breaks the iOS version as I haven't moved the code to build the ios
version. Maybe this will be a good excuse for me to setup a proper CI/CD
system for ios builds.
There is also a chance this breaks Crashalytics NDK symbols :(
The Git Api was strange and took a foldeName and it would only allow you
to access git operations in a particular path. This has now been fixed,
and now it can operate in any path.
This was the first step to moving the git api into its own library.
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
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.
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)
It seems we are moving towards a more generalized Note taking
application. I'd still like to use it for both Note taking and
Journaling. I'm not sure how to clearly show it is meant for both.
Folders for now can only be created under the root folder. I cannot seem
to figure out how to design a good interface for designing how to choose
the parent folder.
This adds a new 'Folders' screen which shows you all your folders and
lets you manage the notes inside them. It currently doesn't allow you to
add or remove Folders, though.
This nearly addresses #18
Now when adding/editing/removing a note, it gets modified from the
directory it was present in. There is no longer a just a plain list of
all notes, but always a tree of notes, which are inside Folders.
Now clicking on a Folder shows all the notes from that folder. You can
even modify the notes, but deleting and adding notes won't work
correctly right now.
This is just me experimenting with how the folder listing could look
like, and the different libraries I could use - For now I'm using the
https://github.com/ajilo297/flutter_tree_view library which I've forked
into this file, as it requires many many modifications to get it to how
I want it to work. Plus the library is really simple.
I'm add a different interface for viewing Notes, similar to card viewer,
and it'll be nice to have a distinction between Journal viewing and Note
Viewing. The biggest difference is that when viewing a Journal, there is
a timeline and you want to be able to easily move between Journal
entries. Whereas with notes, they aren't connected in any obvious way.
It seems that in dark mode the text is not visible as the primary color
remains white. This is a bug in flutter.
https://github.com/flutter/flutter/issues/32180
Thanks to William Lim for reporting.
When configuring the Git Repo server, we could optionally track one folder
in the root git repo, instead of just the root folder. This was
specifically to address my use case where I have my journals in a
sub-directory. The setup screen was super ugly, though.
Since now I'm in the process of adding folder support because of #18, I
can remove this hack. It simplifies the code a lot.
It used to get discarded which was really bad usability. The worst case
is that the user didn't want to save the note, and then they can easily
just delete it, but we shouldn't loose information.
The OAuthFlow doesn't work properly in ios, for now lets just ignore
these exceptions as short of forking the url_launcher, I see no other
way of fixing this.
If the Flutter team can release a fix in a week or so, then I'll just
wait, otherwise I'll probably just fork the url_launcher and close the
FSafariViewController on receiving an error. It wouldn't be a proper
fix, but it will work around the issue.
https://github.com/flutter/flutter/issues/30642