Skip to content

Instantly share code, notes, and snippets.

@fredgrott
Created April 10, 2024 19:16
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 fredgrott/5f4f0d628fe577268b5fd39ee8e94e59 to your computer and use it in GitHub Desktop.
Save fredgrott/5f4f0d628fe577268b5fd39ee8e94e59 to your computer and use it in GitHub Desktop.
json examples
// 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