Add copyWith method and make UserFeedback constructor const #384
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a copyWith method to UserFeedback class for creating modified copies of instances.
📜 Description
This change adds a
copyWithmethod to theUserFeedbackclass, allowingcreation of modified copies of an existing instance.
The constructor was also marked as
const, enabling compile-timeinstantiation when possible. Both changes are additive and backward-compatible.
💡 Motivation and Context
UserFeedbackis effectively an immutable data container. Adding acopyWithmethod makes it easier to derive modified versions of an existing instance
without manually copying all fields.
This follows common Flutter and Dart patterns for immutable model classes and
improves ergonomics when extending or transforming feedback data.
💚 How did you test it?
The change is purely additive and does not affect existing behavior.
The
copyWithmethod was verified manually to ensure:📝 Checklist
🔮 Next steps
None. This change is self-contained and does not require follow-up work.