Skip to content

Instantly share code, notes, and snippets.

@ericgrandt
Created May 6, 2019 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericgrandt/fdb293140f3e05ee91793f4595979c23 to your computer and use it in GitHub Desktop.
Save ericgrandt/fdb293140f3e05ee91793f4595979c23 to your computer and use it in GitHub Desktop.
class User {
int id;
String name;
User({
this.id,
this.name,
});
factory User.fromJson(Map<String, dynamic> json) => new User(
id: json['id'],
name: json['name'],
);
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment