For this journaling app, even though we are treating journal entries as
notes, we don't really any 'id'. Just the filename is quite adequate. In
the future, we can figure out this 'id' nonsense, and if it is even
required given that we're always going to be built on top of a FS.
This sucks balls. Overall, the datetime handling in Dart is really
really bad. It just has the concept of local time or utc time. There are
a few packages which attempt to solve this, but none which really solve
it in the way I would like.
All I want is someway to generate an iso8601 string with the timezone.
And that my DateTime should be aware of the timezone as an offset east
of UTC. Is that really so hard?
Now notes are saved in the git repo, and immediately synced. This is not
the best implementation, as the notes are being reloaded a lot, and
the error handling is terrible (I miss golang). But it's the first
working poc.
We get the path ourselves as the 'git plugin' is using the
android 'getFilesDir()', instead of 'getDataDir()' which is what the
path_provider returns.
It's strange that it returns the latter as the Android docs clearly
state that one should not use this path and should use getFilesDir
instead.
This simplifies the code quite a bit, at the cost of using this
strange flutter magic of an 'InheritedWidget'.
It basically make a class a global variable.