Created
April 10, 2024 19:16
-
-
Save fredgrott/5f4f0d628fe577268b5fd39ee8e94e59 to your computer and use it in GitHub Desktop.
json examples
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
// decode | |
final json = json.decode(...); | |
final archive = KeyedArchive.unarchive(json); | |
final person = Person()..decode(archive); | |
//encode | |
final person = Person()..name = "Bob"; | |
final archive = KeyedArchive.archive(person); | |
final json = json.encode(archive); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment