Last active
June 28, 2021 10:11
-
-
Save imsaravana369/b15d3b0b62d4930a514c30e009efc2b6 to your computer and use it in GitHub Desktop.
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
void main() { | |
String jsonString = r'{"name":"Saravanan","age":20}'; | |
Map<String,dynamic> jsonMap = json.decode(jsonString); | |
Person p = Person.fromJson(jsonMap); | |
print("${p.name}, ${p.age}"); //prints Saravanan, 20 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment