In my app, there are many situations where I need to save/cache any response received from Spotify server.
spotify-dart providers me the option to instantiate the models from Json/Map, but the option to converting the models to Json/Map isn't available. Since, spotify-dart uses JsonSerializable to achieve serialization, we can simply toggle on the toJson method generation.
Also, I'm curious about why createToJson is set to false and will be grateful if you let us know.
My guess is dependency size, but dart removes dead/unused code, so that shouldn't be a problem.
In my app, there are many situations where I need to save/cache any response received from Spotify server.
spotify-dart
providers me the option to instantiate the models fromJson
/Map
, but the option to converting the models toJson
/Map
isn't available. Since,spotify-dart
usesJsonSerializable
to achieve serialization, we can simply toggle on thetoJson
method generation.Also, I'm curious about why
createToJson
is set to false and will be grateful if you let us know. My guess is dependency size, but dart removes dead/unused code, so that shouldn't be a problem.