Replies: 1 comment
-
|
Is anyone there? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, thank you for the great work on Freezed!
I'm trying to model a subclass that extends a base class, and I want to avoid repeating all the fields from the base class in the subclass constructor. Here's what I have:
I know this does not compile, but my goal is to:
Inherit all the fields and default values from BaseDeviceInfo
Add a few new fields in the subclass (uls, ull, etc.)
Avoid repeating all the parameters from the base class again
Be able to instantiate SHC27TDeviceInfo() with no arguments (using default values), or with some optional named parameters
examples:
In many Freezed examples, the subclass constructor repeats all base class fields again, which becomes verbose and error-prone.
Is there a recommended way to do this kind of model composition/inheritance with Freezed?
Thanks a lot in advance!
Beta Was this translation helpful? Give feedback.
All reactions