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

refactor: make network response a sealed class #14

Merged
merged 10 commits into from
Sep 17, 2024
Merged

Conversation

btrautmann
Copy link
Contributor

📰 Summary of changes

What is the new functionality added in this PR?

This PR changes NetworkResponse from being a freezed model to being a proper sealed class, allowing dart's switch/pattern matching syntax.

🧪 Testing done

What testing was added to cover the functionality added in this PR

No functional behavior has changed, all tests should pass.

@btrautmann btrautmann requested review from a team as code owners September 17, 2024 19:06
@JsonKey(ignore: true)
/// Create a copy of SturdyHttpEvent
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
Copy link
Contributor

Choose a reason for hiding this comment

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

just curious why this freezed file changed so much when the only change in the base file was removing an import 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Likely because when I cloned and pub get'd, a different (higher) version of freezed was pulled than the one that generated the original file, and new code is generated with the newer version.

Because pana failed (version decreased) I'm looking at upgrading some packages anyway so that may help make that more intuitive.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK @ClaireDavis, should be good to go now!

Copy link
Contributor

@ClaireDavis ClaireDavis left a comment

Choose a reason for hiding this comment

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

domain lgtm

@btrautmann
Copy link
Contributor Author

/no-platform

@btrautmann btrautmann merged commit 023a01b into main Sep 17, 2024
3 checks passed
@btrautmann btrautmann deleted the bt/response-changes branch September 17, 2024 20:24
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.

3 participants