-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
null-safety & some other cleanup #16
null-safety & some other cleanup #16
Conversation
repeatAfter: repeatAfter ?? this.repeatAfter, | ||
subtasks: subtasks ?? this.subtasks, | ||
labels: labels ?? this.labels, | ||
attachments: attachments ?? this.attachments, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea of the copyWith
method is that it returns a copy of the Task with the modifications specified.
I think the check might be failing because there is a new version of Flutter available and it's trying to use the newer versions which are incompatible with the versions in the pubspec.lock maybe? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I'm okay with all the changes. Also, I'm sorry, some changes I made in the migrations were not well though through, but my schedule has been very full in the last couple of weeks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we iron out those last few things I think this is ready to merge!
lib/models/list.dart
Outdated
'created': created.toIso8601String(), | ||
'updated': updated.toIso8601String(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.toUtc is needed here and in every other toJSON as the API fails to handle timestamps with timezones correctly. I'm not sure if this is the API's fault or flutter's. toUtc is a workaround, we should probably address this at some point in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, seems to work for me. When I made requests directly (in python) it was giving me the proper timezone and it didn't seem to have difficulty when I gave it back. I added the .toUtc()
anyway.
Regardless, I'm not sure these are editable for the client as the documentation for 'updated'
says:
updated
string
A timestamp when this task was last updated. You cannot change this value.
So perhaps we should remove the 'created'
and 'updated'
from the toJSON
s?
Thanks so much for your work! Merged it and will release a new version soon |
Nice work you two! |
Don't merge it into main quite yet. Just realized there is a couple other quirks, such as not being able to remove due dates. I'll submit another PR shortly. |
Sorry, read your comment too late. Create a new PR and I'll merge it. |
Cleans up the null-safety migration and does a little other cleanup.