schultek / dart_mappable

Improved json serialization and data classes with full support for generics, inheritance, customization and more.
https://pub.dev/packages/dart_mappable
MIT License
153 stars 23 forks source link

Allow using dart_mappable for private classes #167

Open momrak opened 7 months ago

momrak commented 7 months ago

I have tried to use this for a private class, but have not managed to get it working

CleanShot 2024-02-14 at 07 41 50

What is the correct syntax to make this work?

schultek commented 7 months ago

Sorry, private classes are not supported atm.

momrak commented 7 months ago

Aha, I see. Any plans for supporting it, or is it not on the roadmap?

schultek commented 7 months ago

I need to revisit the code. I know right now I'm explicitly forbidding private classes but I don't know anymore why.

momrak commented 7 months ago

Hehe, I see. That happens! Should I renamed this issue to Allow using dart_mappable for private classes and keep it open as a feature request?

momrak commented 7 months ago

Title updated to reflect feature request/enhancement

JCKodel commented 2 weeks ago

Concrete use case here:

I was trying to apply vertical slice architecture using partial dart files (part and part of). Since my entity class is not used anywhere outside its slice, it makes sense for it to be private.