I think we all agree that JSON deserialization is one of the most common tasks we as developers of #Dart and #Flutter applications, have to perform regularly, which means that implementation efficiency in this area has a significant impact on the overall speed and ease of the development. Yet over and over I see a few pretty common scenarios.
Some folks prefer to do JSON deserialization manually, which is more time-consuming and error-prone than using code generation. And even if they do use code generation, they’d have data models with JSON deserialization logic, corresponding domain models with similar structure, and mappers that copy data back and forth between data and domain models, maybe with slight modifications.
Clearly, such an approach has a big benefit: if there's a change in the data structure received from the backend, the required application change is minimal and is contained in the deserialization logic, so that the domain model structure remains unchanged and thus no further updates are required in the business logic layer and above. This is a very important benefit, and in my session “Is your JSON deserialization implementation efficient?” at the #FullStackFlutterConference, I’ve shown how to achieve the same result with less code.
The recording is already available on my YouTube channel, linked below!