Instance

of

'address'

When what you probably want is output like the following:

name:

John

address:

street:

My

st.

city:

New

York

}}

To make this work, pass explicitToJson: true in the @JsonSerializable()
annotation over the class declaration. The User class now looks as follows:

For more information, see explicitToJson in the
JsonSerializable class for the json_annotation package.

Further references

For more information, see the following resources:

The dart:convert and JsonCodec documentation

The json_serializable package on pub.dev

The json_serializable examples on GitHub