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

Migrate to using freezed package for immutability instead of equatable #3

Merged
merged 15 commits into from
Mar 5, 2024

Conversation

MoralCode
Copy link
Contributor

This PR replaces equatable with freezed and also uses it to handle generation of JSON serialization and deserialization code

the sketchiest parts of this:

  • I couldnt figure out why the automatic casing of the JSON keys wasn't working (was causing unit tests to fail because values like firstName werent getting populated), so i just manually set the necessary ones (i.e. the ones that are more than one word)
  • Something was complaining about the fact that JsonKey shouldn't be used in the area where I used it, but since it solved the problem and couldn't figure out how better to do it based on the docs for the library. so i added top of file annotations to silence the warnings

The incomplete parts of this:

  • the Results object has a couple JSON values that appear to be derived from existing values (date_utc, time_formatted, which seem like they could be derived from date and time, or the other way around, or combined into just a single DateTime value in dart). I haven't gotten around to figuring out how to make this part work yet.

Unit tests still pass with no changes made to them.

Will leave open a bit prior to merge to give an opportunity for feedback

@MoralCode MoralCode merged commit 6ce6eb7 into main Mar 5, 2024
1 check failed
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.

None yet

1 participant