The Address class is nested inside the User class:

Running 
flutter pub run build_runner build --delete-conflicting-outputs
in the terminal creates
the *.g.dart file, but the private _$UserToJson() function
looks something like the following:

Map

String

dynamic

_$UserToJson

User

instance

String

dynamic

>{

'name'

instance

name

'address'

instance

address

};

All looks fine now, but if you do a print() on the user object:

The result is:

name:

John

address:

Instance

of

'address'