224 Commits

Author SHA1 Message Date
63170445d7 Move libgit2 code to git_bindings repo
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 :(
2019-12-21 01:06:15 +01:00
70877438eb Git: Take the folderPath instead of folderName
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.
2019-12-20 20:40:00 +01:00
3657a88ce5 FolderListing: Show the full path of subfolders
It's confusing otherwise, though this doesn't look very pretty.
2019-12-14 12:18:52 +01:00
591ba30762 Fix flutter analyze 2019-12-11 21:48:46 +01:00
abb6029798 Allow Folders to be deleted
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
2019-12-11 21:43:08 +01:00
453a6c518d Allow Sub Folders to be created
Fixes #34
2019-12-11 21:18:12 +01:00
27d5af8b01 FolderListing: Change the scaffold when a folder is selected
This way it's way more obvious. Also, add a back button so the user can
cancel the selection more explicitly.
2019-12-11 21:09:40 +01:00
b0b7da5291 Move storage classes into core
The Git functionality is fairly core!
2019-12-09 01:19:44 +01:00
cd24d2688f Never let the Note be in an invalid state
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.
2019-12-09 01:14:45 +01:00
ca83cb79a6 JournalListing: Remove recursive option
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.
2019-12-09 00:53:53 +01:00
8a49d948f0 StateContainer: Do not call setState when the notesFolder changes
The NotesFolder is now a listenable and is always accessed via Provider,
and therefore doesn't need setState to be called when it is modified.
2019-12-08 02:58:56 +01:00
0b1a41f3bd FolderListing: Use Provider to fetch the NotesFolder
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.
2019-12-07 16:30:39 +01:00
d0107b6a26 Fix flutter analyze 2019-12-06 23:58:22 +01:00
8c6a33456a Allow folders to be renamed
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)
2019-12-06 21:32:41 +01:00
4c2285a2cc JournalList: Implement Hero transition
This was especially challenging because of this bug -
https://github.com/flutter/flutter/issues/36220

It's why we need the extra flightShuttleBuilder
2019-12-06 12:32:51 +01:00
199e298903 JournalEditor: Show "note" instead of "Journal"
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.
2019-12-05 17:40:08 +01:00
7d223509c8 JournalListing: Show Folder name in title 2019-12-05 17:38:40 +01:00
975b235df3 Add Folder creation
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.
2019-12-05 17:08:02 +01:00
ca2102a8b0 Expose the Folders view
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
2019-12-04 15:33:30 +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
10d65cd6fb Rename NoteFolder -> NotesFolder 2019-12-04 15:33:27 +01:00
464b7512e9 Move Note and NoteFolder class into a core folder 2019-12-04 14:18:11 +01:00
50b8238c27 FolderListing: Hook it up to the JournalListing
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.
2019-12-04 01:30:23 +01:00
d607bad299 JournalListing: Only show the notes in that folder
Do not show all notes recursively, by default. The default screen will
now only show the notes in the root folder.
2019-12-04 01:30:10 +01:00
c8bfa0e2a0 Move FolderTreeView into its own file 2019-12-04 01:14:17 +01:00
10c4de0769 FolderTreeView: Simplify the code drastically 2019-12-04 01:09:58 +01:00
f2e40d4baf FolderListing: Indent sub-folders 2019-12-04 00:56:29 +01:00
3a3f9c7ad6 FolderListing: Show a leading arrow if the Folder has SubFolders
Also change the Arrow if the folder is expanded.
2019-12-04 00:51:41 +01:00
56ccf00260 FolderListing: Show the actual folders
Also don't load hidden folders
2019-12-04 00:35:29 +01:00
3f8159a353 Add the first iteration of a Folder Listing screen
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.
2019-12-03 23:57:13 +01:00
f86a878a9c Split AppBar Menu button into its own widget
Saves us the need to the GlobalKey as well.
2019-12-03 22:35:23 +01:00
dda557e1bf Split HomeScreen into JournalListingScreen
The HomeScreen might need to show either a JournalList or some other
kind of listing.
2019-12-02 14:07:57 +01:00
abd5f09453 Renamed NoteEditor -> JournalEditor 2019-12-02 13:56:38 +01:00
474d396ad6 Rename NoteBrowsingScreen to JournalBrowsingScreen
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.
2019-12-02 13:16:55 +01:00
b7b6dc213e SearchBar: Make sure the text is visible
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.
2019-12-01 15:39:44 +01:00
103520e5e5 SSH Key Comment: Add Operating System and current Date
It's useful info
2019-12-01 12:19:28 +01:00
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
6a9fe72e8d fixed git-clone-url-regex for dash-domains 2019-11-28 23:11:34 +01:00
bb564f1511 Settings: Use SwitchListTile instead of our custom widget
I didn't know this widget existed.
2019-11-02 10:56:28 +01:00
0d760348ce Settings: Split widgets into their own file 2019-11-02 10:40:03 +01:00
d5f91cb898 More prefer_const
It seems like flutter analyze might have some kind of cache
2019-10-20 01:24:43 +01:00
ffc0af12a3 Enable prefer_const_constructors 2019-10-20 01:11:53 +01:00
e8d8c58bff Setting Dialogs: Remove margins and add a Cancel button 2019-10-19 12:07:31 +01:00
c2247c26e9 Settings: Use Radio buttons in dialogs
Instead of highlighting the last selected option.
2019-10-19 12:02:13 +01:00
b4fd9d33f7 Settings: Make 'Dark Theme' a toggle
There are just two options. It doesn't make sense to open a dialog box
and then let the user choose.
2019-10-19 11:53:29 +01:00
af36bbdfd4 Move note empty checking to the Note class 2019-10-11 18:35:00 +02:00
704c8f4ce1 NoteEditor: Do not save a note if it has not been modified
This would result in empty commits :(
2019-10-11 17:24:48 +02:00
e9cfb1fde7 NoteEditor: The backButton should save the note
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.
2019-10-11 17:20:53 +02:00
cb399a9586 RawEditor: Use a monospace font
It looks way way nicer. Also it really highlights how you're editing the
raw contents of the file.
2019-10-11 17:07:39 +02:00
0ad3a9e2e6 OAuthLaunch: Ignore Platform exceptions
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
2019-10-11 16:42:23 +02:00