53 Commits

Author SHA1 Message Date
d2b1ad7e46 Allow loading ssh keys from a file
Fixes #74
2020-10-02 17:22:30 +02:00
b3ea9c9565 Avoid using deprecated autovalidate 2020-10-02 16:17:05 +02:00
43269bbe53 Add lots of listen: false when using Provider
Provider version 4 has an assert which fires if used incorrectly.
2020-09-28 00:09:14 +02:00
4b3f1669f5 Stop caching the gitBaseDir
It makes the entire code base far more complicated and the round trip to
get the directory really isn't that much. This is a massive
micro-optimization for very little benefit.
2020-09-26 18:52:28 +02:00
fe08834259 Split Settings into AppSettings and Settings
This way I can eventually change Settings into RepoSettings without
breaking anything.
2020-09-25 00:33:54 +02:00
f30c52f595 Move all persistent state from AppState to Settings
This way all the persistant state of the app is managed from the same
place. It makes everything much easier. Also, it's required for when
GitJournal supports multiple repositories.
2020-09-24 23:45:37 +02:00
c8e3318bb9 HostSetup: Make all remaining strings translatable 2020-09-04 18:46:16 +02:00
45af5c3863 RepoSelector: Add language colours
This is disabled for now, as the new UI is still a WIP

Fetched from https://github.com/Diastro/github-colors
2020-09-04 02:39:31 +02:00
a05e9d04de Setup: Make more strings translatable 2020-09-04 01:57:01 +02:00
482250f253 RepoSelector: Remove overflow animation 2020-09-03 21:50:23 +02:00
721153308e RepoSelector: Show the datetime in relative terms
Unless it is more than 30 days
2020-09-03 21:50:23 +02:00
624998721e RepoSelector: Try making it prettier
It's a mess, so for now lets go back to the previous design, but I still
want to keep this code.
2020-09-03 21:50:20 +02:00
b96513b25f RepoSelector: Mark strings as translatable 2020-09-03 20:05:49 +02:00
f2f10433d9 AutoConfigure: Make it clear what permissions will be requested 2020-08-21 12:36:42 +02:00
7936cc70b8 Analytics: Make all events into enums
No more random strings
2020-08-17 15:29:38 +02:00
16cea4e079 AutoConfigure: Mark strings as translatable 2020-08-10 11:06:14 +02:00
633d9f5744 Remove more instances of Settings.instance
Use the Provider
2020-08-09 01:50:36 +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
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
5d7f616c6e const++ 2020-07-21 10:46:03 +02:00
97812e1501 Convert more prints to logs
This way they will show up in the LogViewer
2020-06-10 13:25:22 +02:00
66a76a0767 Revert "Use flutter_web_auth instead of our own OAuth mechanism"
This reverts commit 763cbf8493c610dec0e7e344bee40ad331e7a272.
This reverts commit ddad699b259bafe6c7ed630e7afc2eb38b7825e6.

This is causing way too many problems -

On Android with GitHub we occasionally get a User Cancelled exception.
On iOS this doesn't work < ios11

I prefer keeping my way till then. Even though it doesn't support
KeepAlive on Android.
2020-06-10 11:53:43 +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
ddad699b25 Fix flutter analyze 2020-06-09 18:56:51 +02:00
cd9d128b47 Workaround intl bug by harding 'en' locale
https://github.com/dart-lang/intl/issues/266

This is strange since Intl.getLocale() returns 'en_US' in my case.

Currently, GitJournal only supports 'english' anyway, so this shouldn't
be a big problem.
2020-06-09 18:23:43 +02:00
763cbf8493 Use flutter_web_auth instead of our own OAuth mechanism
This works slightly better on iOS and on Android it has a keep alive,
which will prevent our app from being killed. Additionally, this way
there is less for me to maintain, which is always nicer.

The API for flutter_web_auth is also much simpler.

This also inolves some custom logic for parsing the Query Parameters
from the GitLab callback, as it doesn't seem to be a proper URI. Not
sure what is going on with Gitlab.
2020-06-09 17:09:38 +02:00
7226bc1c41 Setup: Reset state of some variables
That way if we go back and try to restart the previous errors are
cleared.
2020-06-09 17:08:42 +02:00
ee1009b087 Avoid hardcoding the git repo folder's name everywhere
This way, in the future we can support multiple repos, and more
importantly it will be easier to reconfigure the git host.
2020-05-26 23:49:57 +02:00
0d3648768c GitLab manual setup: Fix url
GitLab seems to have changed the url to add a deploy key manually.
2020-05-26 13:43:41 +02:00
630b4896e6 RepoSelector: Allow text to be easily cleared 2020-05-18 23:09:14 +02:00
b193b75254 Setup: Move generating ssh key + deploy key code out of widget
It's strange, but this widget routinely gets constructed twice. So
performing a long async operation (generating the ssh key + adding it as
a deploy key) from initState, results in it being called twice. I'm not
sure where the state is initialized twice.

Even adding a unique key to the widget did not help. In the end, I've
just moved the code to its parent widget.
2020-05-18 18:19:26 +02:00
5123938e53 Setup: Rename screen to Loading/Error screen
It's all that it does. This way we can re-use this screen in other
places.
2020-05-18 18:13:21 +02:00
ca934f79d5 CloneRepo: Avoid creating a .gitignore file if not required
It's easier if there is always at least 1 commit in a repo. Creating a
commit with a .gitignore file was a simple way to ensure that. However,
we can also just check for the presence of any other file. This way, we
avoid the extra commit.
2020-05-15 15:31:16 +02:00
18db4899b2 GitHostSetup: Allow the user to choose between repos
This way they don't need to use a repo called 'journal'.
2020-05-15 15:28:44 +02:00
9b878bf2bb Remove useless method 2020-05-14 12:51:12 +02:00
66eeaa552b Bump git_bindings and pass fresh version of gitAuthor/Email
This way the Settings change for git author is immediately reflected.

Fixes #130
2020-05-13 11:36:08 +02:00
b2d0cf44ab Stop using deprecated TextStyle properties 2020-05-08 10:55:00 +02:00
49bf02bf15 logEvent: Parameters must be <String, String>{}
Not string, dynamic. Sentry wants strings.
2020-05-01 10:50:09 +02:00
ff2ac647c5 Remove unused imports 2020-04-17 10:33:31 +02:00
6c47016c8b logException: Also log to Sentry 2020-04-17 09:42:19 +02:00
2eda892285 Remember to dispose text controllers 2020-04-14 17:53:17 +02:00
bb0e574495 Abstract out the logging
This way moving away from Fimber will be much easier.
2020-04-04 11:50:57 +02:00
4f02559849 Remove spaces from public key's comment
Apparently this breaks things in some systems

Fixes #87
2020-03-23 13:07:42 +01:00
b2709f94f1 HostSetup: Allow keys to be regenerated even with a custom setup 2020-03-16 01:20:33 +01:00
4a6355d687 Setup: Fix validation of private keys
For #85
2020-03-16 01:13:27 +01:00
5ec3af70a6 More comprehensive setup analytics 2020-03-01 15:28:56 +01:00
a0e3e50b4a HostSetup: Track if using GitHub/GitLab/other 2020-03-01 15:21:30 +01:00
d5176041be Fix flutter analyze 2020-02-19 22:48:04 +01:00
6c7606efd3 KeyEditor: Do not let Next work until valid values are provided 2020-02-19 18:17:08 +01:00
12e16f83e5 KeyEditors: Remove code duplication 2020-02-19 18:06:59 +01:00