57 Commits

Author SHA1 Message Date
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
a8de212430 Port most of the editors to null safety 2021-05-25 12:39:35 +02:00
94f8307315 Fix exceptions
Minor problems because of the null safety migration
2021-05-25 11:04:47 +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
8eb8905d6d Add Editor Heuristics to Journal Editor
I frequently make lists in the Journal Editor and it's annoying that
these features aren't available.
2021-02-03 19:24:19 +01:00
04228cb497 Fix Experimental Markdown Toolbar
It's now again visible
2021-02-03 16:34:30 +01:00
2c071fb792 Disable undo/redo for editors where it hasn't been implemented 2021-02-03 16:06:28 +01:00
ebff34b753 Basic implementation of undo/redo
It's not great, as the granularity is too low. But it's a good first
step. It only works in the RawEditor so far.
2021-02-03 16:03:15 +01:00
e80fff575c Move Editor Heuristics to be self contained
This way it can easily be used in other editors
2021-02-03 11:56:20 +01:00
350fbb1ccf MarkdownEditor: Handle title change marking note as modified 2021-02-02 16:25:43 +01:00
8c3abe7b65 MarkdownEditor: Remove undo/redo poc
Figured out a better way to do, and it's better if this is in a separate
class as it needs to be reused with different editors.
2021-02-02 16:22:09 +01:00
2199cd2a3a Add some scaffolding for undo/redo
I don't want to lose these changes and putting them in a branch will
result in merge conflicts.
2021-01-22 10:11:35 +01:00
265e253584 Generate one journal entry per day
Fixes #243
2020-09-16 11:08:16 +02:00
7e7503ca2f Editors: Expose the preview markdown button on all editors
It's nice to sometimes use the RawEditor to edit something and then
later you want to see what it looks, and having to switch to the
Markdown Editor for that is very annoying.
2020-08-20 11:47:31 +02:00
6ba0f3974a NoteEditor: Pass it the parentFolder
A note has a parent which is the physical folder it is inside, and a
parent folder which it is being displayed inside. It's useful to have
the latter as that can be used to display the next note - in the case of
the Journal Editor, and open the graph view as well.
2020-08-20 10:42:39 +02:00
2c8bf8d5ae Make the MarkdownToolbar prettier 2020-08-15 12:29:37 +02:00
c7a956c5bf Give MarkdownToolBar to TextEditingController
Instead of handling every single callback.
2020-08-13 00:12:25 +02:00
9d55b449d3 Settings: Access it through the Provider
Make it a ChageNotifier and try to access it through the Provider
instead of like a global variable. This way, the state is better
managed and it'll be easier to split out Settings into smaller classes.
2020-08-09 01:29:22 +02:00
33c5aae23e MarkdownToolBar: First attempt at the toolbar
This can be enabled via 'Settings -> Experimental'. It's very rough
right now and a lot still needs to be done.

Related to #157
2020-08-06 13:40:45 +02:00
2ef2ccdf23 Editors: Allow the title to be edited even when YAML is disabled 2020-07-29 16:27:15 +02:00
15b978cacb Editors: Remove code duplication 2020-07-28 15:37:31 +02:00
606b3d8c24 Fork ChangeNotifier
The EditorStates are inheriting from State and using the ChangeNotifier
mixin. Both the ChangeNotifier and the State class have a dispose
function, which needs to be call.

Without this only the ChangeNotifier's dispose method was being called.
2020-07-27 10:17:17 +02:00
e9cc050866 Implement a basic Zen Mode
This can be enabled in all the editors.
2020-07-27 09:39:31 +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
c31edc3b57 MarkdownEditor: Change default mode to "Last Used"
Add an extra option of Last Used, along with Edit / View.
2020-07-06 17:14:07 +02:00
9a39960c03 EditorHeuristics: Handle edge cases 2020-06-04 02:12:06 +02:00
f4cc8e2b47 Refactor Auto bullet list in Editor
The earlier code base was a bit fragile, I prefer having this
unit-tested as the logic is a bit tricky, and I still don't support all
the use-cases.
2020-06-01 20:55:04 +02:00
9a726ba8db MarkdownEditor: Improve auto-bullet points
This patch scares me quite a bit. It's taken forever, and even now we
don't add a bullet point if we edit the middle of a list.
2020-06-01 17:55:42 +02:00
3808624655 MarkdownEditor: Auto add bullet points when editing
If the user presses Enter and were previously editing a bullet point,
then we should add a new bullet point with the same indentation.

This is a massive hack, and I don't like the way it is implemented. It
sucks that I cannot seem to access the keyboard events for the
TextField.

Fixes #140
2020-06-01 17:18:36 +02:00
327fddcae2 Journal/Markdown Editor: Change tick-mark back to cross when empty
When creating a new note, if some text is written and then removed, we
should update the icon accordingly. Ideally it would be awesome if this
could be done for any changes, but I think comparing the body of the
note after each change might be too expensive.
2020-05-31 09:56:28 +02:00
4208b05bb4 NoteEditor: Only enable 'Discard Changes' option if we have changes
Otherwise disable the button.
2020-05-19 00:02:07 +02:00
79ece901a8 Editors: Implement didUpdateWidget
The parent sometimes changes the noteModified parameter. It's strange
for me that the stateless widgets aren't always rebuilt if their parent
widget's properties change.
2020-05-14 12:49:52 +02:00
2847e3f60f Add basic tag support
This allows you to be modify the tags from the NoteEditor. Related to
 #114. We still need to add some way to filter the notes by tag. Also,
the current tag editor doesn't show the tags from the other notes.
2020-05-13 01:01:40 +02:00
b2d0cf44ab Stop using deprecated TextStyle properties 2020-05-08 10:55:00 +02:00
62b5761ec4 Editors: Do not use BottomAppBar in the scaffold property
The BottomAppBar when given in the Scaffold gets hidden when the
keyboard is visible. We had hacked around that by translating its
position, however that resulted in the cursor at the bottom being hidden
when we were typing a long note.

It is not just part of the body of the scaffold.

Also converted many functions into widgets.
2020-05-06 15:16:37 +02:00
f421b61fd4 Editor: Replace the scroll view
This one supresses the top glow animation, has a decent padding by
default, and occupies the entire space of its parent.
2020-05-06 14:20:56 +02:00
b26cfe8b81 Avoid mutating the state while building the Editor's bottom bar
getNote() mutates the state
2020-05-05 12:33:20 +02:00
b17c184900 Add very basic Image support [Android only]
This adds a '+' button to the NoteEditor which allows you to add an
image from either the Gallery or Take a photo. It then accordingly adds
updates markdown.

The file is added in the same directory as the note for now.

Related to #10
2020-05-05 12:02:36 +02:00
48b6fa21f7 NoteEditor: Build a bottom bar which shows the current folder
Also allow notes to be moved to a folder.
2020-05-05 10:00:14 +02:00
9ee16ebe50 Editor: Show ✕ or ✓ in AppBar depending on if the note has been modified
Fixes #123
2020-05-01 10:14:18 +02:00
4e593d6c2f Fix crash 2020-05-01 09:38:49 +02:00
29b002b0f0 MarkdownEditor: New notes should always be in edit mode
Fixes #119
2020-04-25 21:34:22 +02:00
bc32e5bbb3 Editors: Rename autofocus to isNewNote
It's more descriptive, and lets each edit decide how it wants to handle
new notes vs existing.
2020-04-25 21:33:42 +02:00
afe94da638 MarkdownEditor: Allow the default view to be configurable
Fixes #98
2020-04-16 13:16:40 +02:00
e98b3c3e41 Remove duplication of NoteTitleEditor 2020-03-30 12:00:50 +02:00
3e38628102 Add a 'type' to each Note
This way we can load the appropirate editor according to the types
available.
2020-03-19 02:36:59 +01:00
c2c617753d Enable auto-correct
This actually makes a difference on iOS.
2020-03-08 20:37:47 +01:00
dae3d1aec9 Remove the FAB
Fixes #58

I've tried adding a black space under the FAB, but that just reduces the
available vertical space while typing. This does reduce the usability
for small notes, as clicking on the FAB is much easier than clicking on
top-right back button or clicking the back button twice on Android.
2020-02-28 12:34:56 +01:00
a49876e3ee Remove the title editor if it cannot be stored
It just makes it confusing for the user otherwise.
2020-02-19 23:00:52 +01:00
27ebd9686b RawEditor: Give focus when using it for a new note 2020-02-18 16:31:34 +01:00