You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then I get the following error -> The type '_$CreateVehiclePayloadModel' must be 'base', 'final' or 'sealed' because the supertype 'CreateVehiclePayloadModel' is 'final'.. In order to make it work, I have to manually add any of the mentioned modifiers, but I think it is not ideal, adding modifiers manually for each generated class is painful.
The text was updated successfully, but these errors were encountered:
I agree, I think final modifier would be great to have due to the benefits it provides, like preventing subclassing.
I think creating a built_value class with sealed modifier would not provide much value, at the end of the day if I will use that modifier I have to create its own subclass abstract interface class extending from the sealed class and then the abstract final built_value class implementing the created subclass, so there is no need of having the generated class marked as sealed. For the base modifier I have a similar thought.
This is just my POV and just providing the example following the good practices, also taking into account some complex models with generic types, but I don't know if someone could fall in the need of generating a built_value class with the sealed, base or another modifier.
Hi @davidmorgan, hope you are doing pretty well!
The generated code is not respecting the classes modifiers in case we mark our class with one, example:
Entity
Model
Then, if I run the command
flutter pub run build_runner build --delete-conflicting-outputs
, I get the following generated file:Then I get the following error ->
The type '_$CreateVehiclePayloadModel' must be 'base', 'final' or 'sealed' because the supertype 'CreateVehiclePayloadModel' is 'final'.
. In order to make it work, I have to manually add any of the mentioned modifiers, but I think it is not ideal, adding modifiers manually for each generated class is painful.The text was updated successfully, but these errors were encountered: