48 Commits

Author SHA1 Message Date
7ba8faa57f Remove the entire concept of a subFolder
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.
2019-12-01 12:04:45 +01:00
5d69dd9de2 AppState: Remove isLoadingFromDisk
It isn't actually used anywhere. I want to simplify this as much as
possible, as I want the note loading to be as lazy as possible.
2019-10-20 00:54:34 +01:00
69003cf0ac Rename package from journal -> gitjournal
It's about time.
2019-10-07 19:30:50 +02:00
c144f14816 Avoid saving hasJournalEntries
It can be a simple getter
2019-10-04 04:37:41 +02:00
3d8aa2ad70 AppState: Move loading/saving to where the data lies 2019-10-04 04:35:02 +02:00
890fd059d4 Remove unused base class 2019-09-26 17:27:29 +02:00
186f6b0af3 Refactor: Remove FileStorage
With this, the application compiles again. And note editing is working
again. This is was the first of some small refactors in order to
implement both async note loading and a support for directories.
2019-09-26 17:22:52 +02:00
11a9023e99 Allow the Note FileName to be configured
This is super ugly, but it solves a real use case, and hopefully I'll
eventually get around to improving the UI of the Settings page.
2019-09-25 15:41:19 +02:00
74d7bdd763 Use a proper logger - Fimber
It's time to start using a proper logger so we can control the number of
log messages, also - it helps to have a central configuration point for
the logs, specially since I would like to hook them up to Crashlytics in
the future.
2019-06-19 09:45:15 +02:00
89f7c10ba9 Analytics: Send events when the notes are loaded
I want to know why they failed to load.
2019-06-14 17:26:51 +02:00
2bfd6ea199 setState may not be async 2019-06-02 15:58:57 +02:00
8ff5d02033 DartLinter: Add unnecessary_this 2019-02-23 01:33:34 +01:00
29c8da11fb Enable OnBoarding 2019-02-16 13:24:48 +01:00
475315785c Delete Note: Do not sync untill the snackbar has gone
Otherwise we would have already pushed that change to the server, and
undo-ing it will be impossible.
2019-02-15 20:12:13 +01:00
a32f01b2c4 Implement undo delete properly
This way the git History is not modified.
2019-02-15 19:58:58 +01:00
428c0bb611 Note Edit: Immediately update that note in the list
Otherwise, it's only after syncing and reloading the entire list of
notes do we see the update. This process is usually quite fast, but
not always.
2019-02-14 23:45:50 +01:00
ac7d7f7445 Disable onBoarding screen for now
I want to make a new release, and the onboarding is clearly not ready.
2019-02-14 14:35:04 +01:00
03e46ce8cd Allow notes to be stored inside a sub-folder in a git repo 2019-02-14 12:59:43 +01:00
8345f1424e Note: Rename 'fileName' to 'filePath'
A note can reside in a subfolder, so lets just use the path as an
identifier instead of using just the fileName.
2019-02-14 12:07:23 +01:00
c819f49afe Add a very basic onBoardingScreen 2019-02-14 01:44:57 +01:00
6fea27e0ca Show +1 notification badge after user has made a journal entry 2019-02-14 01:11:35 +01:00
acede95536 Dart: Add analysis_options
For now I've mostly tried to follow the same style guide as the flutter
repository, with many options disabled. Eventually, maybe it would make
sense to be far stricter.
2019-02-13 13:08:15 +01:00
285a900e76 Rename OnBoarding to GitHostSetup
It was either GitHost or GitRemote.
2019-01-25 12:05:32 +01:00
170983024c Fix Clone screen not disappearing
and other misc changes
2019-01-23 12:48:37 +01:00
2b1ac6cad7 Hookup onBoarding screen to app
* I should probably stop calling in an onboarding screen, since it's now
just a way to setup sync.

* It overall feels quite ugly, and unpolished.
2019-01-23 12:13:02 +01:00
a29a102667 Move git api to apis folder 2019-01-23 11:54:02 +01:00
519de8fcff Remove onboarding screen
For now just create a local git repo and commit all the changes over
there, we're going to allow the user to first see the app and use it
however they want, and later connect it to a remote git repo.

This commit breaks the app, as the on-boarding screen is no longer
connected so you cannot push to a remote app.
2019-01-21 13:43:33 +01:00
c99fe854a1 Note: Replace 'id' with 'fileName'
It all just makes far more since when each Note has a fileName.

Though we don't save the fileName in the YAML header. It seems quite
redundant to do that.

Another advantage of this is that if we can read any file ending with a
'.md' in a git repo. It doesn't need to be named exactly how we want it,
and we will still save the details correctly.
2019-01-18 16:12:03 +01:00
4292555286 Pull to sync: Show a snackbar with an error message
The error message is quite basic right now -
"No Connection" or the full error returned to us by the java libraries.
But it's a start!
2019-01-16 23:20:07 +01:00
d6c2d5d05a Note id: Default to created and do not save if not required
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.
2019-01-15 21:41:39 +01:00
38218fd9a3 Only save and load .md files
For now I only want to deal with markdown. In the future, we can move
towards maybe accepting all .txt files as well? Not sure.
2019-01-15 21:23:26 +01:00
5a2b0f1f4b Allow the notes to be refreshed by pulling from the top 2019-01-15 15:26:15 +01:00
075d353447 Write the date time in iso8601 + timezone
This is not perfect as when parsing the datetime, we're ignoring the
timezone.
2019-01-15 15:10:43 +01:00
04b65fbf95 Filename: Use iso8601 string
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?
2019-01-15 14:41:51 +01:00
89c878f1cd Remove half cloned git repos
It can fail to clone and leave some residual .git files
2019-01-11 19:29:34 +01:00
fe84aab6b7 RemoveExistingClone if onboarding is not completed
This only happens when I manually delete the shared_prefs. It's
basically a way to make working on the onboarding much easier.
2019-01-10 13:32:03 +01:00
eac9857c17 Persist onBoardingCompleted 2019-01-10 13:22:21 +01:00
a5830ccbc4 Load the journal list after onboarding 2019-01-10 13:03:00 +01:00
4bb02b12d6 Hookup the Journal app to git
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.
2019-01-09 12:55:53 +01:00
fb3f3bfccf Avoid using the path_provider plugin
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.
2019-01-07 16:34:25 +01:00
104d54efc3 Fix tests 2018-06-03 20:19:20 +02:00
2082bea8ac Move some classes into another folder
Just giving some more structure
2018-06-03 19:49:34 +02:00
9d19ee4c14 Make FileStorage a NoteRepository 2018-06-03 19:44:36 +02:00
69998c37f9 Add/Remove individual notes from disk
Instead of rewriting all of them on save.
2018-06-03 19:34:46 +02:00
2c68865c46 FileStorage: Allow the note filename to be customizable 2018-06-03 19:34:14 +02:00
157fc425dc FileStorage: Use the YAML Markdown serializer
Instead of saving stuff in json.
2018-06-03 19:14:25 +02:00
0551cc0538 Note Deletion: Implement undo 2018-05-25 01:05:17 +02:00
b6c38dde3c Use an InheritedWidget instead of passing the callbacks
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.
2018-05-24 12:33:46 +02:00