Skip to content

Instantly share code, notes, and snippets.

@fredgrott
Created April 10, 2024 19:21
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/98759166caa008178cc91480b07f2a5a to your computer and use it in GitHub Desktop.
Save fredgrott/98759166caa008178cc91480b07f2a5a to your computer and use it in GitHub Desktop.
json dynamic casting
class Container extends Coding {
List<String> things;
@override
Map<String, cast.Cast<dynamic>> get castMap => {
"things": cast.List(cast.String)
};
@override
void decode(KeyedArchive object) {
super.decode(object);
things = object.decode("things");
}
@override
void encode(KeyedArchive object) {
object.encode("things", things);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment