25 Commits

Author SHA1 Message Date
c6665fa63e Simplify Settings/Config classes 2021-07-29 12:45:33 +02:00
c66eaf1052 NotesFolderConfig: Read directly from the SharedPref
It's super annoying that we have this class which reading from the
settings, so adding any new value involves updating some 12 new things.
2021-07-27 16:33:16 +02:00
a45e8e4fe1 fix test 2021-06-29 20:04:48 +02:00
d6e2f09a72 Move all settings code to its own folder
Jumping around between the widgets / screens and outside is bit
confusing. Also this way, I can add the stories right here.
2021-06-05 12:23:28 +02:00
96c2809d3e Migrate most of the tests to null safety 2021-05-19 12:09:45 +02:00
d008f0d982 First version of dart migrate
Most of the files haven't been migrated. Lets work on this bit by bit
2021-04-10 22:18:35 +02:00
d2d9504dc9 Make sure all notes end with a \n
Fixes #383
2021-03-26 10:09:15 +01:00
5280917e7a Minor refactor 2021-02-09 12:00:52 +01:00
f75e119995 Make Settings take the folderName as a parameter 2020-10-23 02:29:48 +02:00
9499cea164 Remove Settings global
Stop it being a singleton. This means it needs to be passed around a
lot. This sucks, but it's how it should be. I shouldn't be using a
global variable to get around this.

This is needed as Settings will soon become repo specific when we
support multiple repos.

This breaks saving the settings in a file, that feature was toggled off
anyway. It needs to be thought over again.
2020-10-09 00:59:19 +02:00
cd9ae57a71 Fix tests 2020-08-10 09:59:20 +02:00
9d00fdac06 Use import_sorter
flutter pub run import_sorter:main --no-comments

The code feels much cleaner
2020-07-24 12:43:28 +02:00
88552fe8e9 Revert "Workaround intl bug by harding 'en' locale"
This reverts commit 303192d9d575b26a77a00f7a62212f310ec1e329.
This reverts commit cd9d128b47ed523036f7ae1232ec7adcf04ed8a9.

GitJournal is used by non-English speakers (a lot in China and Russia)
and while we don't support those languages completely, we do support
them a little bit. I don't want to loose this functionality. It would be
better for us to fix the bug in intl.
2020-06-10 09:31:08 +02:00
303192d9d5 Initialize intl in tests
This sucks.
2020-06-09 18:44:37 +02:00
56d8f635eb Note class should not be sortable
There are various different methods of sorting an note.
2020-03-06 20:14:21 +01:00
46a38cdedf Rename NoteData -> MdYamlDoc
It more clearly defines what exactly it is.

This is important as its less confusing for when we add support for
other file types.
2020-02-14 08:12:41 +01:00
36d1ae43c3 Split NoteData and its serializer into its own file 2020-01-01 19:50:31 +01:00
a33fb88fb0 Fix tests paths 2019-12-09 01:42:01 +01:00
5b8fc6342a Connect the AppState to the Folders
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.
2019-12-04 15:33:30 +01:00
464b7512e9 Move Note and NoteFolder class into a core folder 2019-12-04 14:18:11 +01:00
06824ccee3 Note: Setting the 'created' property should update the NoteData
We shouldn't just do it when saving the note, this way when viewing the
raw editor, the created field is show for new notes.
2019-10-11 02:18:34 +02:00
69003cf0ac Rename package from journal -> gitjournal
It's about time.
2019-10-07 19:30:50 +02:00
475251df61 Preserve the YAML sorting order
Also refactor this a bit so Note contains a NoteData. I'm really not
convinced about today's abstractions, and feel I might have made this
entire thing much much worse.
2019-09-26 18:52:01 +02:00
2b43de6e93 Test out Note deletion 2019-09-26 16:46:41 +02:00
6f8a149d57 Refactor Note class
The loading/saving/deleting of the Note class is now inbuilt. It's not
offloaded to a NoteRepo. We're always going to be storing them on disk,
for now. It's also way easier to manage them this way.
2019-09-26 16:42:52 +02:00