Hey folks, in this video I want to show you how to convert Dart objects into JSON and vice versa using the json_serializable and json_annotation packages in Flutter, as well as the build_runner package. In this video I will go over some fundamentals about what JSON is and why it could be useful to your mobile application, how it can be used for transmission to a backend server. We’ll then go over how the object conversion can be done manually in Dart and what the benefits are of automatic code generation for data classes.
I hope this video is valuable to you and if it is, don’t forget to subscribe and hit the notification bell to stay updated with new content on KarimCodes - cheers!
Chapters:
00:00 Intro
00:28 Example design
01:51 Dart implementation
06:30 Testing the results