Since reflection makes all code implicitly used by default, it makes tree
shaking difficult. The tools cannot know what parts are unused at runtime, so
the redundant code is hard to strip away. App sizes cannot be easily optimized
when using reflection.

Although you cannot use runtime reflection with Flutter,
some libraries give you similarly easy-to-use APIs but are
based on code generation instead. This
approach is covered in more detail in the
code generation libraries section.

Serializing JSON manually using dart:convert

Basic JSON serialization in Flutter is very simple. Flutter has a built-in
dart:convert library that includes a straightforward JSON encoder and
decoder.

The following sample JSON implements a simple user model.

With dart:convert,
you can serialize this JSON model in two ways.

Serializing JSON inline