amugofjava / podcast_search

A simple library providing programmatic access to the iTunes search API for podcasts.
MIT License
41 stars 26 forks source link

Would be nice if all models were json serializable #17

Open sgehrman opened 11 months ago

sgehrman commented 11 months ago

I want to pass from backend to frontend, and it would be easier if they would serialize to json.

amugofjava commented 10 months ago

Hi @sgehrman,

This is an interesting idea. Are you thinking of just being able to serialise the models to JSON, or also thinking of de-serialising JSON back into the models?

loveoverflowdev commented 9 months ago

Flutter doesn't support Reflection like Java. So you cannot see any framework like GSON. Actually, Dart language supports mirror, which is similar to Reflection, but this feature was ignored by Flutter

amugofjava commented 9 months ago

You're right, Flutter doesn't support reflection but there are ways this request can be achieved. You can serialise/deserialise objects to/from JSON manually (my preferred approach) or via code gen using a package such as json_serializable.