Serialize complex (nested) objects and List of objects in Flutter/Dart

I want to tell you the story of a young programmer who wanted to do a nice serialization of complex objects in dart. This guy could go with code generation libraries like Freeze, but he wanted to have full control so he decided to go on his own. Unfortunately, there are no good tutorials about it, so he had to spend a lot of time figuring out the proper way of doing it and I want to share this knowledge with you right now.

Let’s assume we have a data structure like this:



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store