Created
September 11, 2019 05:53
-
-
Save Dalmangyi/ac758314007d20e1c060a9695a708bb9 to your computer and use it in GitHub Desktop.
Dart_model_json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Dog { | |
final int id; | |
final String name; | |
Dog({this.id, this.name}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Dog { | |
final int id; | |
final String name; | |
Dog({this.id, this.name}); | |
factory Dog.fromJson(Map<String, dynamic> json) => Dog( | |
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