48 Commits

Author SHA1 Message Date
510b277398 Add Note.apply
Avoid calling each setter as each results in the entire tree being
rebuilt.
2021-09-16 20:07:33 +02:00
20634a9899 NotesFolderFS: Avoid propagating faulty signals
Ideally this shouldn't have ever been called, but the NotesFolderFS +
Note class is a mess.
2021-09-16 16:38:50 +02:00
045b4d0cd1 Add experimental tag auto-completion
There is so so much more to do to get this to work. I'm not sure if
exposing it like this is a good idea. Oh well.
2021-09-15 17:15:08 +02:00
33a731a3d7 Add reuse licensing to files in lib 2021-09-15 13:06:43 +02:00
637666b5e4 Add search term highlighting to all the editors
Minus the checklist editor
2021-09-08 02:04:50 +02:00
3d348fe66f Avoid hardcoding the text highlight color
This also fixes text selection not being very visible in the dark mode.

Related to #467
2021-09-07 18:13:55 +02:00
bdcc0593c2 Write a custom RichTextController
This one is far simpler and doesn't take word boundaries into
consideration, which is how GitJournal's search works.
2021-09-07 17:49:44 +02:00
f03fa13bf3 RawEditor highlight should be case insensitive
Like the search
2021-09-07 16:31:39 +02:00
79afcfce23 RawEditor TextHighlight: Fix in the case of no highlight 2021-08-31 12:48:36 +02:00
5ea80fb617 Note: Move Image code to its own class
The Note class is way way too huge and has too many responsabilities. I
would like the Note class to be very small and immutable.
2021-08-31 12:30:47 +02:00
6367466c1b RawEditor: Small experiment to show the searched text
Related to #477
2021-08-30 23:21:37 +02:00
910088a5b4 LocaleKeys++ 2021-08-26 23:09:39 +02:00
72e9de29de Move editor related code into its folder
I'm trying to separate the code based on the domain so that this code
can be easily reused in other projects
2021-07-30 11:12:00 +02:00
d4a345ea89 Avoid using 'dart:io' wherever possible
This gets us one step closer to supporting the web.
2021-07-01 01:46:01 +02:00
a8de212430 Port most of the editors to null safety 2021-05-25 12:39:35 +02:00
ee2f0e85aa Editors: Remove the padding
This is weird. In some themes there in an internal padding, and in some
themes, there in none. I didn't think themes would affect this.

Also isDense and isCollapsed work in strange ways. I wish this was
properly documented.

I basically want to remove the left padding, and insert a normal top and
bottom padding. Is that too much to ask?
2021-05-06 15:15:52 +02:00
d40c1992cc Editors: Remove hover color change 2021-05-06 15:15:52 +02:00
3d07328aab Editors: Set background color
With Flutter 2, the way the theme has set has changed, so I'm slowly
migrating to Flex Color Scheme, and fixing all the widgets that look
strange.
2021-05-06 15:15:52 +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
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
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
e6e0e08fe4 Mark more strings as translatable 2020-08-10 12:16:03 +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
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
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
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
27ebd9686b RawEditor: Give focus when using it for a new note 2020-02-18 16:31:34 +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
23c6192162 Editor: Add 'Discard Changes' button
It got removed while merging the editor/viewer
2020-01-31 15:55:25 +01:00
a2b3c8d9e6 Add const 2020-01-30 18:41:51 +01:00
ddb7303fea Reduce code duplication between Editors
It also makes it so much easier to implement a new editor.
2020-01-30 17:42:29 +01:00
43281bd2bb Add support for moving a Note to another folder
The Folder selection dialog needs a lot of work, but it's a start.
2020-01-29 16:51:57 +01:00
db5d2c51e7 RawEditor: Add a FAB 2020-01-29 00:04:28 +01:00
3f40a2992a Add the concept of Editors
* We no longer have a separate editing and browsing view - This does
mean we loose the ability to quick flip between notes by swiping.
However, this is more how a note editor would behave. I do later want to
add that capability back.

* We have 2 editors for now - Markdown and Raw. By default we use the
Markdown editor which can be toggled between Preview / Edit mode.

I later want to add a rich text editor and a todo editor as well.
2020-01-29 00:04:24 +01:00