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

Feature: Generate client serialization classes #56

Open
wstrange opened this issue Mar 13, 2023 · 0 comments
Open

Feature: Generate client serialization classes #56

wstrange opened this issue Mar 13, 2023 · 0 comments

Comments

@wstrange
Copy link

wstrange commented Mar 13, 2023

Something that serverpod.dev does that is pretty nifty is to generate model serialization code, and put the classes in a separate dart client package. It makes it really easy for a developer to pull the client package into a flutter app (or any client app). Until you use it, it's hard to appreciate what a game changer it is. It makes development much faster.

One thought might be to use something like Freezed to define the "model" class, with the proper annotations. Freezed gives you serialization, and a bunch of other nice features.

There are going to be properties of a freezed model that you don't want sent to the database. I think you could handle those using some kind of @ignore annotation (or re-use JsonKey?).

Food for thought..

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

No branches or pull requests

1 participant