Skip to content
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 fixes #17

Merged
merged 4 commits into from
Sep 8, 2022
Merged

Conversation

k9withabone
Copy link
Contributor

@k9withabone k9withabone commented Sep 7, 2022

I think I got all the bugs? If there is more let me know and I'll fix them.

@kolaente kolaente requested a review from Benimautner September 7, 2022 21:19
@@ -14,7 +14,7 @@ class Bucket {
final List<Task> tasks;

Bucket({
this.id = -1,
this.id = 0,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to 0 as discussed in #16.

DateTime? endDate,
bool? clearEndDate,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows for clearing the dates by setting them to null if the corresponding bool is true.

@@ -43,13 +43,16 @@ getRepeatAfterValueFromDuration(Duration? repeatAfter) {
return repeatAfter.inHours;
}

getDurationFromType(String? value, String? type) {
Duration? getDurationFromType(String? value, String? type) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added return types to make it less ambiguous.

endDate: _endDate,
clearEndDate: _endDate == null,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dates will be null when cleared.

@k9withabone k9withabone marked this pull request as ready for review September 7, 2022 21:24
@Benimautner Benimautner merged commit 57b2198 into go-vikunja:main Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants