class Address { final int? id; final String streetName; final String comments; Address({ this.id, required this.streetName, required this.comments, }); factory Address.fromMap(Map json) => Address( id: json["id"], streetName: json["street_name"], comments: json["comments"], ); Map toMap() => { "id": id, "street_name": streetName, "comments": comments, }; }