28 Commits

Author SHA1 Message Date
8b67abbc83 APIs: Make the tests pass with null safety 2021-05-27 13:56:56 +02:00
5a40d35ec8 apis: port to null safety 2021-05-18 10:48:33 +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
78b25af47a Bump deps for Flutter 2
Also for handling the latest dart-git. This required disabling -
* ssh_key - Feature toggle (off by default) for generating the ssh key
in dart. This was causing problems.
* screenshots
* flutter_driver - used by screenshots

flutter_driver was nice to have as it was the only proper integration
test that we have.

Also, many of the tests currently fail because of problems with Sentry.
I prefer to fix those in another commit
2021-03-25 11:05:42 +01:00
df78b24542 GitHostRepo: Add name and username
Instead of having to parse this from the fullName. This way the code is
easier to read and it's more reliable.
2020-11-13 15:36:24 +01:00
9e045519bb Add tests for GitHub & GitLab apis for fetching the list of repos 2020-09-05 11:18:54 +02:00
ccf5f65e55 List Repos: Print the http req as curl
Makes it easier to test
2020-09-05 11:03:15 +02:00
0c92ab2d26 GitLab: Fix license parsing 2020-09-03 21:53:54 +02:00
e4fd84d4a4 RepoList: Parse more information
This way in the future we can make the repo list a bit prettier. It
currently looks quite ugly.
2020-09-03 20:54:46 +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
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
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
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
bb0e574495 Abstract out the logging
This way moving away from Fimber will be much easier.
2020-04-04 11:50:57 +02:00
f119e60b79 OAuth: close the webview explicitly afterwords
Hopefully this will fix the problem on iOS
2020-04-02 17:21:25 +02:00
74d7bdd763 Use a proper logger - Fimber
It's time to start using a proper logger so we can control the number of
log messages, also - it helps to have a central configuration point for
the logs, specially since I would like to hook them up to Crashlytics in
the future.
2019-06-19 09:45:15 +02:00
d653663a47 Change Git dart API
Use a class instead of a many functions. This way we avoid passing the
same arguments again and again.
2019-06-17 19:38:56 +02:00
c79249cbe1 Dart: Give all functions explicit types
It makes the code easier to understand and this way the static type
checker will catch bugs for us.
2019-06-02 15:51:43 +02:00
9ce4e5b1b9 DartLinter: Add prefer_collection_literals 2019-02-23 01:36:32 +01:00
06dc62e967 GitSetup: Use the 'journal' repo if it already exists 2019-02-14 11:06:49 +01:00
c5c4d44431 GitHost: Improve error handling
In the case of OAuth errors which we get through the message
channel, throwing an exception doesn't help us as the init function
will not be aware about it.

So for now, I've moved the nodejs style error handling in this
particular case.
2019-02-13 22:43:34 +01:00
acede95536 Dart: Add analysis_options
For now I've mostly tried to follow the same style guide as the flutter
repository, with many options disabled. Eventually, maybe it would make
sense to be far stricter.
2019-02-13 13:08:15 +01:00
dc29d523cc GitSetup: Get the user's name + email from the GitHost
This way they aren't committing under the name of 'GitJournal'.
2019-02-09 16:47:53 +01:00
8e9e3a91b5 GitHosts: Throw RepoExists exception 2019-01-25 15:11:09 +01:00
86f01ab7d1 GitHosts: Improve error handling 2019-01-25 15:03:42 +01:00
fb202e0f1f GitHost AutoConfigure: Handle errors a bit better 2019-01-25 14:52:56 +01:00
ac5c2be05d Add a GitHost interface
GitLab and GitHost are two implementations of that interface.
2019-01-25 11:21:58 +01:00
f8a066d5d9 Add API for GitLab
It's so awesome that I don't need to store the client secret with
GitLab. The GitHub APIs are so much easier to use + documentation, but
at least GitLab supports more OAuth methods.
2019-01-24 18:19:50 +01:00