Manual decoding does not perform well when your project becomes bigger.
Writing decoding logic by hand can become hard to manage and error-prone.
If you have a typo when accessing a nonexistent JSON
field, your code throws an error during runtime.

If you do not have many JSON models in your project and are
looking to test a concept quickly,
manual serialization might be the way you want to start.
For an example of manual encoding, see
Serializing JSON manually using dart:convert.

Use code generation for medium to large projects

JSON serialization with code generation means having an external library
generate the encoding boilerplate for you. After some initial setup,
you run a file watcher that generates the code from your model classes.
For example, json_serializable and built_value are these
kinds of libraries.